HBaseModel
Functions
Detailed Description
-
class
HBaseModel
The HBaseModel class is used to store and manage model information.
HBaseModel provides functions which facilitate creation and management of the graphical information associated with the model. It is typically referenced by an HBaseView object, which defines a specific view of the model.
The class encapsulates a HOOPS Include Library segment. This segment is intended to be used as the root of a HOOPS tree containing segments and geometry which represent graphical information for the application-specific model. A file can be read into it, or geometry can be created within a segment hierarchy beneath it.
Public Functions
-
HBaseModel
(char const *model = 0) Constructs an HBaseModel object.
-
virtual
~HBaseModel
() Deletes the HOOPS segment tree associated with the model.
-
virtual void
Init
() Initializes an HBaseModel object.
-
virtual void
Flush
() Flushes the HOOPS segment tree associated with the HBaseModel object.
-
inline bool
GetFileLoadComplete
() const Returns: A boolean indicating whether a Read() has completed.
-
void
SetFileLoadComplete
(bool value, HBaseView *pHView = 0) Sets the boolean indicating whether a Read() has completed.
-
inline bool
GetObjectCheck
() const Returns: A boolean indicating whether to scan model for annotations and other objects.
-
inline void
SetObjectCheck
(bool value) Sets the boolean indicating whether to scan model for annotations and other objects.
-
void
SetStaticModel
(bool value) Sets the static model status at the root of the model segment.
-
bool
GetStaticModel
() const Returns the existence of a static model at the root of the model segment.
-
bool
GetStaticModelOn
() const Returns if a static model is requested at the root of the model segment.
-
void
SetLMVModel
(bool value) Sets the LMV model status at the root of the model segment.
-
bool
GetLMVModel
() const Returns the existence of a LMV model at the root of the model segment.
-
inline bool
GetFirstFitComplete
() const Returns: A boolean indicating whether HBaseModel has called FitWorld on this model after the last call to Read(). It is not useful for model with multiple views.
-
inline void
SetFirstFitComplete
(bool value) Sets the boolean indicating whether the first call to FitWorld has been performed.
-
inline bool
GetContainsDouble
() const Returns: A boolean indicating whether this model contains double precision attributes. This is set by Visualize on import.
-
inline void
SetContainsDouble
(bool value) Sets the boolean indicating whether this model contains double precision attributes.
-
virtual HFileIOResult
Read
(__wchar_t const *FileName, HBaseView *pHView = 0, bool clean_include = true, HInputHandlerOptions *options = 0) Based on file extention this method loads the content of a file using HInputHandler found in the HIOManager from HDB If no handler is found, it will return InputNotHandled. It does not Flush existing geometry. The default extention is hmf if no other is found.
Parameters: - FileName – A character pointer denoting the name of the file to be read in
- pHView – A pointer to the HBaseView object containing the view-dependent information reading in the model
- clean_include – if true, then includes are moved to unique include location after loading
- options – An optional pointer to an instance of a HInputHandlerOptions contain extra data for input operation.
Returns: HFileInputResult with result of the attempted file read.
-
inline virtual HFileIOResult
Read
(char const *FileName, HBaseView *pHView = 0, bool clean_include = true, HInputHandlerOptions *options = 0)
-
virtual HFileIOResult
WriteWithOptions
(__wchar_t const *FileName, HBaseView *pHView = 0, HOutputHandlerOptions *options = 0) - Reads the visualization contents of the file into the HOOPS segment tree (visualization contents refers to graphical information/attributes). The segment tree will be created underneath the segment denoted by m_ModelKey. The HIO handler registered to handle the specified file extension will be used for import.
This function can be overloaded to support reading of additional file types. \param FileName A character pointer denoting the name of the file to write \param pHView A pointer to the HBaseView object containing the view-dependent information \param options An optional pointer to an instance of a HOutputHandlerOptions contain extra data for output operation. \return HFileOutputResult with result of the attempted file write.
- Reads the visualization contents of the file into the HOOPS segment tree (visualization contents refers to graphical information/attributes). The segment tree will be created underneath the segment denoted by m_ModelKey. The HIO handler registered to handle the specified file extension will be used for import.
-
inline virtual HFileIOResult
WriteWithOptions
(char const *FileName, HBaseView *pHView = 0, HOutputHandlerOptions *options = 0)
-
virtual HFileIOResult
Write
(__wchar_t const *FileName, HBaseView *pHView = 0, float width = 0, float height = 0) Writes the contents of the HOOPS segment tree to a file. The HOOPS segment tree beginning with the segment denoted by m_ModelKey will be written. The HIO handler registered to handle the specified file extension will be used for export.
This function should be overloaded to support writing of additional file types.
Note
for the ‘.pdf’ file extension, a 2D-PDF will be exported by default.
Parameters: - FileName – A character pointer denoting the name of the file to write
- pHView – A pointer to the HBaseView object containing the view-dependent information
- width – For 2D or ‘paper’ export formats, the m_Window_Width and m_Paper_Width are set to ‘width’. For image formats, the width of the actual image in pixels will be ‘width’ * m_Image_Dpi. Default is 0.
- height – For 2D or ‘paper’ export formats, the m_Window_Height and m_Paper_Height are set to ‘height’. For image formats, the height of the actual image in pixels will be ‘height’ * m_Image_Dpi. Default is 0.
Returns: HFileOutputResult with result of the attempted file write.
-
inline virtual HFileIOResult
Write
(char const *FileName, HBaseView *pHView = 0, float width = 0, float height = 0)
-
HModelInfo *
GetHModelInfo
() const Returns: A pointer to the HModelInfo object with the current model info.
-
inline virtual HStreamFileToolkit *
GetStreamFileTK
() const Returns: A pointer to the stream toolkit object used with this model for writing and reading HSF files.
-
inline virtual HC_KEY
GetModelKey
() const Returns: The key of the encapsulated HOOPS segment denoting the top of the model hierarchy .
-
inline virtual HC_KEY
GetModelIncludeKey
() const Returns: The key of the encapsulated HOOPS segment denoting the top of the model’s include segment hierarchy.
-
inline virtual HC_KEY
GetBBoxKey
() const Returns: The key of the HOOPS segment containing the model’s bounding box geometry.
-
inline virtual bool
IsBRepGeometry
() const Returns: A boolean indicating whether data originated from a CAD dataset. This is used so that we do not use HOOPS’ edges for display but rather the polylines which are provided by the modeller. This is set by setting a User_Option of 1 in the root of your scene-graph. This is automatically set if the data originated from ACIS or Parasolid and you used the framework to generate the file.
-
inline virtual void
SetBRepGeometry
(bool brep) This method indicates if this model represents geometric modeler data but wasn’t necessarily loaded from the modelling kernel. Pass true if yes and false if otherwise.
-
inline virtual bool
IsFEAGeometry
() const Returns: A boolean indicating whether data originated from a FEA dataset. Developers ensure that this flag is automatically set if a User_Option of 2 is set in the root node of their scene-graph.
-
inline virtual void
SetFEAGeometry
(bool fea) This method indicates if the model represents finite-element data. Pass true if yes and false if otherwise.
-
inline virtual bool
IsVectorGeometry
() const Returns: A boolean indicating whether the data is only vector data. This allows HOOPS to force vector printing always and not turn on shading. This is set by setting a User_Option of 3 in the root of your scene-graph.
-
inline virtual void
SetVectorGeometry
(bool vector) This method indicates if the model only contains vector data. Pass true if yes and false if otherwise.
-
virtual void
CleanIncludes
() Utility function which moves global includes to model specific include segments.
-
virtual void
DeleteIncludedSegments
() Scans for all the segments which are included by the model and deletes them.
-
virtual HBhvBehaviorManager *
GetBhvBehaviorManager
() Returns: A pointer to the HBhvBehaviorManager object.
-
void
SetBhvBehaviorManager
(HBhvBehaviorManager *BehaviorManager) Sets the HBhvBehaviorManager object.
-
HEventManager *
GetEventManager
() Returns: A pointer to the HEventManager object.
-
void
Update
(bool antialias = false, bool forceUpdate = false) Performs a rendering update.
Parameters: - antialias – If true, then an anti-aliased version of the scene will be drawn.
- forceUpdate – If true, then an update will be forced.
-
void
MakeAnimationSnapshot
(int tick)
-
virtual HFileIOResult
WriteWithAnimation
(__wchar_t const *FileName, HBaseView *pHView = 0, float width = 0, float height = 0)
-
inline virtual HFileIOResult
WriteWithAnimation
(char const *FileName, HBaseView *pHView = 0, float width = 0, float height = 0)
-
virtual void
CreateIncludeSegment
()
-
TK_Dispatch_XML *
GetDispatchXML
() Returns: A pointer to the DispatchXML object which allows registering of multiple xml handlers.
-