|
Open CASCADE Technology
6.7.1
|
This class allows the definition of groups
of primitives inside of graphic objects (presentations).
A group contains the primitives and attributes
for which the range is limited to this group.
The primitives of a group can be globally suppressed.
There are two main group usage models:
1) Non-modifiable, or unbounded, group ('black box').
Developers can repeat a sequence of
SetPrimitivesAspect() with AddPrimitiveArray() methods arbitrary number of times
to define arbitrary number of primitive "blocks" each having individual apect values.
Any modification of such a group is forbidden, as aspects and primitives are mixed
in memory without any high-level logical structure, and any modification is very likely to result
in corruption of the group internal data.
It is necessary to recreate such a group as a whole when some attribute should be changed.
(for example, in terms of AIS it is necessary to re-Compute() the whole presentation each time).
2) Bounded group. Developers should specify the necessary group aspects with help of
SetGroupPrimitivesAspect() and then add primitives to the group.
Such a group have simplified organization in memory (a single block of attributes
followed by a block of primitives) and therefore it can be modified, if it is necessary to
change parameters of some aspect that has already been set, using methods:
IsGroupPrimitivesAspectSet() to detect which aspect was set for primitives;
GroupPrimitivesAspect() to read current aspect values
and SetGroupPrimitivesAspect() to set new values.
Developers are strongly recommended to take all the above into account when filling Graphic3d_Group
with aspects and primitives and choose the group usage model beforehand out of application needs.
More...
#include <Graphic3d_Group.hxx>

Public Member Functions | |
| Graphic3d_Group (const Handle< Graphic3d_Structure > &AStructure) | |
| Creates a group in the structure <AStructure>. More... | |
| void | Clear (const Standard_Boolean theUpdateStructureMgr=Standard_True) |
| Supress all primitives and attributes of <me>. To clear group without update in Graphic3d_StructureManager pass Standard_False as <theUpdateStructureMgr>. This used on context and viewer destruction, when the pointer to structure manager in Graphic3d_Structure could be already released (pointers are used here to avoid handle cross-reference); More... | |
| void | Destroy () |
| Supress the group <me> in the structure. More... | |
| ~Graphic3d_Group () | |
| void | Remove () |
Supress the group <me> in the structure. <br> Warning: No more graphic operations in <me> after this call. | |
| void | SetGroupPrimitivesAspect () |
| Removes the context for all the line primitives of the group. More... | |
| void | SetGroupPrimitivesAspect (const Handle< Graphic3d_AspectLine3d > &CTX) |
| Modifies the context for all the line primitives of the group. More... | |
| void | SetGroupPrimitivesAspect (const Handle< Graphic3d_AspectFillArea3d > &CTX) |
| Modifies the context for all the face primitives of the group. More... | |
| void | SetGroupPrimitivesAspect (const Handle< Graphic3d_AspectText3d > &CTX) |
| Modifies the context for all the text primitives of the group. More... | |
| void | SetGroupPrimitivesAspect (const Handle< Graphic3d_AspectMarker3d > &CTX) |
| Modifies the context for all the marker primitives of the group. More... | |
| void | SetPrimitivesAspect (const Handle< Graphic3d_AspectLine3d > &CTX) |
| Modifies the current context of the group to give another aspect for all the line primitives created after this call in the group. More... | |
| void | SetPrimitivesAspect (const Handle< Graphic3d_AspectFillArea3d > &CTX) |
| Modifies the current context of the group to give another aspect for all the face primitives created after this call in the group. More... | |
| void | SetPrimitivesAspect (const Handle< Graphic3d_AspectText3d > &CTX) |
| Modifies the current context of the group to give another aspect for all the text primitives created after this call in the group. More... | |
| void | SetPrimitivesAspect (const Handle< Graphic3d_AspectMarker3d > &CTX) |
| Modifies the current context of the group to give another aspect for all the marker primitives created after this call in the group. More... | |
| void | SetMinMaxValues (const Standard_Real XMin, const Standard_Real YMin, const Standard_Real ZMin, const Standard_Real XMax, const Standard_Real YMax, const Standard_Real ZMax) |
| Sets the coordinates of the boundary box of the group <me>. More... | |
| void | Text (const Standard_CString AText, const Graphic3d_Vertex &APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax=Standard_True) |
| Creates the string <AText> at position <APoint>. The 3D point of attachment is projected. The text is written in the plane of projection. The attributes are given with respect to the plane of projection. AHeight : Height of text. (Relative to the Normalized Projection Coordinates (NPC) Space). AAngle : Orientation of the text (with respect to the horizontal). More... | |
| void | Text (const Standard_CString AText, const Graphic3d_Vertex &APoint, const Standard_Real AHeight, const Standard_Boolean EvalMinMax=Standard_True) |
| Creates the string <AText> at position <APoint>. The 3D point of attachment is projected. The text is written in the plane of projection. The attributes are given with respect to the plane of projection. AHeight : Height of text. (Relative to the Normalized Projection Coordinates (NPC) Space). The other attributes have the following default values: AAngle : PI / 2. ATp : TP_RIGHT AHta : HTA_LEFT AVta : VTA_BOTTOM More... | |
| void | Text (const TCollection_ExtendedString &AText, const Graphic3d_Vertex &APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax=Standard_True) |
| Creates the string <AText> at position <APoint>. The 3D point of attachment is projected. The text is written in the plane of projection. The attributes are given with respect to the plane of projection. AHeight : Height of text. (Relative to the Normalized Projection Coordinates (NPC) Space). AAngle : Orientation of the text (with respect to the horizontal). More... | |
| void | Text (const TCollection_ExtendedString &AText, const Graphic3d_Vertex &APoint, const Standard_Real AHeight, const Standard_Boolean EvalMinMax=Standard_True) |
| Creates the string <AText> at position <APoint>. The 3D point of attachment is projected. The text is written in the plane of projection. The attributes are given with respect to the plane of projection. AHeight : Height of text. (Relative to the Normalized Projection Coordinates (NPC) Space). The other attributes have the following default values: AAngle : PI / 2. ATp : TP_RIGHT AHta : HTA_LEFT AVta : VTA_BOTTOM More... | |
| void | AddPrimitiveArray (const Handle< Graphic3d_ArrayOfPrimitives > &elem, const Standard_Boolean EvalMinMax=Standard_True) |
| Adds an array of primitives for display More... | |
| void | Marker (const Graphic3d_Vertex &thePoint, const Standard_Boolean theToEvalMinMax=Standard_True) |
| Creates a primitive array with single marker using AddPrimitiveArray(). More... | |
| void | UserDraw (const Standard_Address AnObject, const Standard_Boolean EvalMinMax=Standard_True, const Standard_Boolean ContainsFacet=Standard_False) |
Creates an UserDraw primitive <br> Category: Methods to create UserDraw | |
| void | SetStencilTestOptions (const Standard_Boolean theIsEnabled) |
| sets the stencil test to theIsEnabled state; More... | |
| void | SetFlippingOptions (const Standard_Boolean theIsEnabled, const gp_Ax2 &theRefPlane) |
| sets the flipping to theIsEnabled state. More... | |
| Standard_Boolean | IsGroupPrimitivesAspectSet (const Graphic3d_GroupAspect theAspect) const |
| Returns TRUE if aspect is set for the group. More... | |
| void | GroupPrimitivesAspect (const Handle< Graphic3d_AspectLine3d > &CTXL, const Handle< Graphic3d_AspectText3d > &CTXT, const Handle< Graphic3d_AspectMarker3d > &CTXM, const Handle< Graphic3d_AspectFillArea3d > &CTXF) const |
| Returns the context of all the primitives of the group. More... | |
| void | PrimitivesAspect (const Handle< Graphic3d_AspectLine3d > &CTXL, const Handle< Graphic3d_AspectText3d > &CTXT, const Handle< Graphic3d_AspectMarker3d > &CTXM, const Handle< Graphic3d_AspectFillArea3d > &CTXF) const |
| Returns the last inserted context in the group <me> foreach kind of primitives. More... | |
| Standard_Boolean | ContainsFacet () const |
| Returns Standard_True if the group <me> contains Polygons, Triangles or Quadrangles. More... | |
| Standard_Boolean | IsDeleted () const |
| Returns Standard_True if the group <me> is deleted. <me> is deleted after the call Remove (me) or the associated structure is deleted. More... | |
| Standard_Boolean | IsEmpty () const |
| Returns Standard_True if the group <me> is empty. More... | |
| void | MinMaxValues (Standard_Real &XMin, Standard_Real &YMin, Standard_Real &ZMin, Standard_Real &XMax, Standard_Real &YMax, Standard_Real &ZMax) const |
| Returns the coordinates of the boundary box of the group <me>. More... | |
| Handle_Graphic3d_Structure | Structure () const |
| Returns the structure containing the group <me>. More... | |
Public Member Functions inherited from MMgt_TShared | |
| virtual void | Delete () const |
| Memory deallocator for transient classes. More... | |
Public Member Functions inherited from Standard_Transient | |
| Standard_Transient () | |
| Empty constructor. More... | |
| Standard_Transient (const Standard_Transient &) | |
| Copy constructor – does nothing. More... | |
| Standard_Transient & | operator= (const Standard_Transient &) |
| Assignment operator, needed to avoid copying reference counter. More... | |
| virtual | ~Standard_Transient () |
| Destructor must be virtual. More... | |
| virtual void | ShallowDump (Standard_OStream &) const |
| virtual const Handle_Standard_Type & | DynamicType () const |
| Returns a type information object about this object. More... | |
| Standard_Boolean | IsInstance (const Handle_Standard_Type &theType) const |
| Returns a true value if this is an instance of Type. More... | |
| Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
| Returns a true value if this is an instance of TypeName. More... | |
| Standard_Boolean | IsKind (const Handle_Standard_Type &theType) const |
| Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
| Standard_Boolean | IsKind (const Standard_CString theTypeName) const |
| Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
| virtual Handle_Standard_Transient | This () const |
| Returns a Handle which references this object. Must never be called to objects created in stack. More... | |
| Standard_Integer | GetRefCount () const |
| Get the reference counter of this object. More... | |
Friends | |
| void | Graphic3d_Structure::Remove (const Handle< Graphic3d_Group > &AGroup) |
Suppress in the structure <me>, the group <AGroup>. <br> It will be erased at the next screen update. | |
This class allows the definition of groups
of primitives inside of graphic objects (presentations).
A group contains the primitives and attributes
for which the range is limited to this group.
The primitives of a group can be globally suppressed.
There are two main group usage models:
1) Non-modifiable, or unbounded, group ('black box').
Developers can repeat a sequence of
SetPrimitivesAspect() with AddPrimitiveArray() methods arbitrary number of times
to define arbitrary number of primitive "blocks" each having individual apect values.
Any modification of such a group is forbidden, as aspects and primitives are mixed
in memory without any high-level logical structure, and any modification is very likely to result
in corruption of the group internal data.
It is necessary to recreate such a group as a whole when some attribute should be changed.
(for example, in terms of AIS it is necessary to re-Compute() the whole presentation each time).
2) Bounded group. Developers should specify the necessary group aspects with help of
SetGroupPrimitivesAspect() and then add primitives to the group.
Such a group have simplified organization in memory (a single block of attributes
followed by a block of primitives) and therefore it can be modified, if it is necessary to
change parameters of some aspect that has already been set, using methods:
IsGroupPrimitivesAspectSet() to detect which aspect was set for primitives;
GroupPrimitivesAspect() to read current aspect values
and SetGroupPrimitivesAspect() to set new values.
Developers are strongly recommended to take all the above into account when filling Graphic3d_Group
with aspects and primitives and choose the group usage model beforehand out of application needs.
| Graphic3d_Group::Graphic3d_Group | ( | const Handle< Graphic3d_Structure > & | AStructure | ) |
Creates a group in the structure <AStructure>.
|
inline |
| void Graphic3d_Group::AddPrimitiveArray | ( | const Handle< Graphic3d_ArrayOfPrimitives > & | elem, |
| const Standard_Boolean | EvalMinMax = Standard_True |
||
| ) |
Adds an array of primitives for display
| void Graphic3d_Group::Clear | ( | const Standard_Boolean | theUpdateStructureMgr = Standard_True | ) |
Supress all primitives and attributes of <me>.
To clear group without update in Graphic3d_StructureManager
pass Standard_False as <theUpdateStructureMgr>. This
used on context and viewer destruction, when the pointer
to structure manager in Graphic3d_Structure could be
already released (pointers are used here to avoid handle
cross-reference);
| Standard_Boolean Graphic3d_Group::ContainsFacet | ( | ) | const |
Returns Standard_True if the group <me> contains
Polygons, Triangles or Quadrangles.
| void Graphic3d_Group::Destroy | ( | ) |
Supress the group <me> in the structure.
| void Graphic3d_Group::GroupPrimitivesAspect | ( | const Handle< Graphic3d_AspectLine3d > & | CTXL, |
| const Handle< Graphic3d_AspectText3d > & | CTXT, | ||
| const Handle< Graphic3d_AspectMarker3d > & | CTXM, | ||
| const Handle< Graphic3d_AspectFillArea3d > & | CTXF | ||
| ) | const |
Returns the context of all the primitives of the group.
| Standard_Boolean Graphic3d_Group::IsDeleted | ( | ) | const |
Returns Standard_True if the group <me> is deleted.
<me> is deleted after the call Remove (me) or the
associated structure is deleted.
| Standard_Boolean Graphic3d_Group::IsEmpty | ( | ) | const |
Returns Standard_True if the group <me> is empty.
| Standard_Boolean Graphic3d_Group::IsGroupPrimitivesAspectSet | ( | const Graphic3d_GroupAspect | theAspect | ) | const |
Returns TRUE if aspect is set for the group.
| void Graphic3d_Group::Marker | ( | const Graphic3d_Vertex & | thePoint, |
| const Standard_Boolean | theToEvalMinMax = Standard_True |
||
| ) |
Creates a primitive array with single marker using AddPrimitiveArray().
| void Graphic3d_Group::MinMaxValues | ( | Standard_Real & | XMin, |
| Standard_Real & | YMin, | ||
| Standard_Real & | ZMin, | ||
| Standard_Real & | XMax, | ||
| Standard_Real & | YMax, | ||
| Standard_Real & | ZMax | ||
| ) | const |
Returns the coordinates of the boundary box of the
group <me>.
| void Graphic3d_Group::PrimitivesAspect | ( | const Handle< Graphic3d_AspectLine3d > & | CTXL, |
| const Handle< Graphic3d_AspectText3d > & | CTXT, | ||
| const Handle< Graphic3d_AspectMarker3d > & | CTXM, | ||
| const Handle< Graphic3d_AspectFillArea3d > & | CTXF | ||
| ) | const |
Returns the last inserted context in the group <me>
foreach kind of primitives.
| void Graphic3d_Group::Remove | ( | ) |
Supress the group <me> in the structure. <br>
Warning: No more graphic operations in <me> after this call.
//! Modifies the current modelling transform persistence (pan, zoom or rotate)
//! Get the current modelling transform persistence (pan, zoom or rotate)
| void Graphic3d_Group::SetFlippingOptions | ( | const Standard_Boolean | theIsEnabled, |
| const gp_Ax2 & | theRefPlane | ||
| ) |
sets the flipping to theIsEnabled state.
| void Graphic3d_Group::SetGroupPrimitivesAspect | ( | ) |
Removes the context for all the line primitives
of the group.
| void Graphic3d_Group::SetGroupPrimitivesAspect | ( | const Handle< Graphic3d_AspectLine3d > & | CTX | ) |
Modifies the context for all the line primitives
of the group.
| void Graphic3d_Group::SetGroupPrimitivesAspect | ( | const Handle< Graphic3d_AspectFillArea3d > & | CTX | ) |
Modifies the context for all the face primitives
of the group.
| void Graphic3d_Group::SetGroupPrimitivesAspect | ( | const Handle< Graphic3d_AspectText3d > & | CTX | ) |
Modifies the context for all the text primitives
of the group.
| void Graphic3d_Group::SetGroupPrimitivesAspect | ( | const Handle< Graphic3d_AspectMarker3d > & | CTX | ) |
Modifies the context for all the marker primitives
of the group.
| void Graphic3d_Group::SetMinMaxValues | ( | const Standard_Real | XMin, |
| const Standard_Real | YMin, | ||
| const Standard_Real | ZMin, | ||
| const Standard_Real | XMax, | ||
| const Standard_Real | YMax, | ||
| const Standard_Real | ZMax | ||
| ) |
Sets the coordinates of the boundary box of the
group <me>.
| void Graphic3d_Group::SetPrimitivesAspect | ( | const Handle< Graphic3d_AspectLine3d > & | CTX | ) |
Modifies the current context of the group to give
another aspect for all the line primitives created
after this call in the group.
| void Graphic3d_Group::SetPrimitivesAspect | ( | const Handle< Graphic3d_AspectFillArea3d > & | CTX | ) |
Modifies the current context of the group to give
another aspect for all the face primitives created
after this call in the group.
| void Graphic3d_Group::SetPrimitivesAspect | ( | const Handle< Graphic3d_AspectText3d > & | CTX | ) |
Modifies the current context of the group to give
another aspect for all the text primitives created
after this call in the group.
| void Graphic3d_Group::SetPrimitivesAspect | ( | const Handle< Graphic3d_AspectMarker3d > & | CTX | ) |
Modifies the current context of the group to give
another aspect for all the marker primitives created
after this call in the group.
| void Graphic3d_Group::SetStencilTestOptions | ( | const Standard_Boolean | theIsEnabled | ) |
sets the stencil test to theIsEnabled state;
| Handle_Graphic3d_Structure Graphic3d_Group::Structure | ( | ) | const |
Returns the structure containing the group <me>.
| void Graphic3d_Group::Text | ( | const Standard_CString | AText, |
| const Graphic3d_Vertex & | APoint, | ||
| const Standard_Real | AHeight, | ||
| const Quantity_PlaneAngle | AAngle, | ||
| const Graphic3d_TextPath | ATp, | ||
| const Graphic3d_HorizontalTextAlignment | AHta, | ||
| const Graphic3d_VerticalTextAlignment | AVta, | ||
| const Standard_Boolean | EvalMinMax = Standard_True |
||
| ) |
Creates the string <AText> at position <APoint>.
The 3D point of attachment is projected. The text is
written in the plane of projection.
The attributes are given with respect to the plane of
projection.
AHeight : Height of text.
(Relative to the Normalized Projection
Coordinates (NPC) Space).
AAngle : Orientation of the text
(with respect to the horizontal).
| void Graphic3d_Group::Text | ( | const Standard_CString | AText, |
| const Graphic3d_Vertex & | APoint, | ||
| const Standard_Real | AHeight, | ||
| const Standard_Boolean | EvalMinMax = Standard_True |
||
| ) |
Creates the string <AText> at position <APoint>.
The 3D point of attachment is projected. The text is
written in the plane of projection.
The attributes are given with respect to the plane of
projection.
AHeight : Height of text.
(Relative to the Normalized Projection
Coordinates (NPC) Space).
The other attributes have the following default values:
AAngle : PI / 2.
ATp : TP_RIGHT
AHta : HTA_LEFT
AVta : VTA_BOTTOM
| void Graphic3d_Group::Text | ( | const TCollection_ExtendedString & | AText, |
| const Graphic3d_Vertex & | APoint, | ||
| const Standard_Real | AHeight, | ||
| const Quantity_PlaneAngle | AAngle, | ||
| const Graphic3d_TextPath | ATp, | ||
| const Graphic3d_HorizontalTextAlignment | AHta, | ||
| const Graphic3d_VerticalTextAlignment | AVta, | ||
| const Standard_Boolean | EvalMinMax = Standard_True |
||
| ) |
Creates the string <AText> at position <APoint>.
The 3D point of attachment is projected. The text is
written in the plane of projection.
The attributes are given with respect to the plane of
projection.
AHeight : Height of text.
(Relative to the Normalized Projection
Coordinates (NPC) Space).
AAngle : Orientation of the text
(with respect to the horizontal).
| void Graphic3d_Group::Text | ( | const TCollection_ExtendedString & | AText, |
| const Graphic3d_Vertex & | APoint, | ||
| const Standard_Real | AHeight, | ||
| const Standard_Boolean | EvalMinMax = Standard_True |
||
| ) |
Creates the string <AText> at position <APoint>.
The 3D point of attachment is projected. The text is
written in the plane of projection.
The attributes are given with respect to the plane of
projection.
AHeight : Height of text.
(Relative to the Normalized Projection
Coordinates (NPC) Space).
The other attributes have the following default values:
AAngle : PI / 2.
ATp : TP_RIGHT
AHta : HTA_LEFT
AVta : VTA_BOTTOM
| void Graphic3d_Group::UserDraw | ( | const Standard_Address | AnObject, |
| const Standard_Boolean | EvalMinMax = Standard_True, |
||
| const Standard_Boolean | ContainsFacet = Standard_False |
||
| ) |
Creates an UserDraw primitive <br>
Category: Methods to create UserDraw
Warning: Raises GroupDefinitionError if ...
|
friend |
Suppress in the structure <me>, the group <AGroup>. <br>
It will be erased at the next screen update.
1.8.5