Open CASCADE Technology
6.9.0
|
This class provides methods to create vector data presentation. It store map of vectors assigned with nodes or elements. In simplified mode vectors draws with thickened ends instead of arrows. More...
#include <MeshVS_VectorPrsBuilder.hxx>
Public Member Functions | |
MeshVS_VectorPrsBuilder (const Handle< MeshVS_Mesh > &Parent, const Standard_Real MaxLength, const Quantity_Color &VectorColor, const MeshVS_DisplayModeFlags &Flags=MeshVS_DMF_VectorDataPrs, const Handle< MeshVS_DataSource > &DS=0, const Standard_Integer Id=-1, const MeshVS_BuilderPriority &Priority=MeshVS_BP_Vector, const Standard_Boolean IsSimplePrs=Standard_False) | |
virtual void | Build (const Handle< Prs3d_Presentation > &Prs, const TColStd_PackedMapOfInteger &IDs, TColStd_PackedMapOfInteger &IDsToExclude, const Standard_Boolean IsElement, const Standard_Integer theDisplayMode) const |
Builds vector data presentation. More... | |
void | DrawVector (const gp_Trsf &theTrsf, const Standard_Real Length, const Standard_Real MaxLength, const TColgp_Array1OfPnt &ArrowPoints, const Handle< Graphic3d_ArrayOfPrimitives > &Lines, const Handle< Graphic3d_ArrayOfPrimitives > &ArrowLines, const Handle< Graphic3d_ArrayOfPrimitives > &Triangles) const |
Adds to array of polygons and polylines some primitive representing single vector. More... | |
const MeshVS_DataMapOfIntegerVector & | GetVectors (const Standard_Boolean IsElement) const |
Returns map of vectors assigned with nodes or elements. More... | |
void | SetVectors (const Standard_Boolean IsElement, const MeshVS_DataMapOfIntegerVector &Map) |
Sets map of vectors assigned with nodes or elements. More... | |
Standard_Boolean | HasVectors (const Standard_Boolean IsElement) const |
Returns true, if map isn't empty. More... | |
Standard_Boolean | GetVector (const Standard_Boolean IsElement, const Standard_Integer ID, gp_Vec &Vect) const |
Returns vector assigned with certain node or element. More... | |
void | SetVector (const Standard_Boolean IsElement, const Standard_Integer ID, const gp_Vec &Vect) |
Sets vector assigned with certain node or element. More... | |
void | GetMinMaxVectorValue (const Standard_Boolean IsElement, Standard_Real &MinValue, Standard_Real &MaxValue) const |
Calculates minimal and maximal length of vectors in map ( nodal, if IsElement = False or elemental, if IsElement = True ) More... | |
void | SetSimplePrsMode (const Standard_Boolean IsSimpleArrow) |
Sets flag that indicates is simple vector arrow mode uses or not default value is False. More... | |
void | SetSimplePrsParams (const Standard_Real theLineWidthParam, const Standard_Real theStartParam, const Standard_Real theEndParam) |
Sets parameters of simple vector arrwo presentation theLineWidthParam - coefficient of vector line width (to draw line instead of arrow) theStartParam and theEndParam parameters of start and end of thickened ends position of thickening calculates according to parameters and maximum vector length default values are: theLineWidthParam = 2.5 theStartParam = 0.85 theEndParam = 0.95. More... | |
![]() | |
virtual void | CustomBuild (const Handle< Prs3d_Presentation > &Prs, const TColStd_PackedMapOfInteger &IDs, TColStd_PackedMapOfInteger &IDsToExclude, const Standard_Integer DisplayMode) const |
This method is called to build presentation of custom elements (they have MeshVS_ET_0D type). IDs is set of numeric identificators of elements for custom building. IDsToExclude is set of IDs to exclude from processing. If some entity has been excluded, it is not processed by other builders. DisplayMode is numeric constant describing display mode (see MeshVS_DisplayModeFlags.hxx) More... | |
virtual Handle < SelectBasics_SensitiveEntity > | CustomSensitiveEntity (const Handle< SelectBasics_EntityOwner > &Owner, const Standard_Integer SelectMode) const |
This method is called to build sensitive of custom elements ( they have MeshVS_ET_0D type ) More... | |
Standard_Integer | GetFlags () const |
Returns flags, assigned with builder during creation. More... | |
virtual Standard_Boolean | TestFlags (const Standard_Integer DisplayMode) const |
Test whether display mode has flags assigned with this builder. This method has default implementation and can be redefined for advance behavior Returns Standard_True only if display mode is appropriate for this builder. More... | |
Standard_Integer | GetId () const |
Returns builder ID. More... | |
Standard_Integer | GetPriority () const |
Returns priority; as priority bigger, as soon builder will be called. More... | |
Handle< MeshVS_DataSource > | GetDataSource () const |
Returns custom data source or default ( from MeshVS_Mesh ) if custom is NULL. More... | |
void | SetDataSource (const Handle< MeshVS_DataSource > &newDS) |
Change custom data source. More... | |
Handle< MeshVS_Drawer > | GetDrawer () const |
Returns custom drawer or default ( from MeshVS_Mesh ) if custom is NULL. More... | |
void | SetDrawer (const Handle< MeshVS_Drawer > &newDr) |
Change custom drawer. More... | |
void | SetExcluding (const Standard_Boolean state) |
Set excluding state. If it is Standard_True, the nodes or elements, processed by current builder will be noted and next builder won't process its. More... | |
Standard_Boolean | IsExcludingOn () const |
Read excluding state. More... | |
void | SetPresentationManager (const Handle< PrsMgr_PresentationManager3d > &thePrsMgr) |
Set presentation manager for builder. More... | |
Handle < PrsMgr_PresentationManager3d > | GetPresentationManager () const |
Get presentation manager of builder. More... | |
![]() | |
virtual void | Delete () const |
Memory deallocator for transient classes. More... | |
![]() | |
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 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... | |
Static Public Member Functions | |
static Standard_Real | calculateArrow (TColgp_Array1OfPnt &Points, const Standard_Real Length, const Standard_Real ArrowPart) |
Calculates points of arrow presentation. More... | |
Additional Inherited Members | |
![]() | |
MeshVS_PrsBuilder (const Handle< MeshVS_Mesh > &Parent, const MeshVS_DisplayModeFlags &Flags, const Handle< MeshVS_DataSource > &DS, const Standard_Integer Id, const MeshVS_BuilderPriority &Priority=MeshVS_BP_Default) | |
Constructor Parent is pointer to MeshVS_Mesh object Flags is set of display modes corresponding to this builder DS is data source object, from which builder will pick geometry and topological information Id is numeric identificator of builder. You must set it to positive integer, but if you set it to -1, constructor will select the smallest integer, not occupied by other builders Priority is numerical priority constant. As priority bigger, as sooner builder starts during presentation construction. More... | |
Handle< MeshVS_DataSource > | DataSource () const |
Returns only custom data source. More... | |
Handle< MeshVS_Drawer > | Drawer () const |
Returns only custom drawer. More... | |
![]() | |
MeshVS_MeshPtr | myParentMesh |
This class provides methods to create vector data presentation. It store map of vectors assigned with nodes or elements. In simplified mode vectors draws with thickened ends instead of arrows.
MeshVS_VectorPrsBuilder::MeshVS_VectorPrsBuilder | ( | const Handle< MeshVS_Mesh > & | Parent, |
const Standard_Real | MaxLength, | ||
const Quantity_Color & | VectorColor, | ||
const MeshVS_DisplayModeFlags & | Flags = MeshVS_DMF_VectorDataPrs , |
||
const Handle< MeshVS_DataSource > & | DS = 0 , |
||
const Standard_Integer | Id = -1 , |
||
const MeshVS_BuilderPriority & | Priority = MeshVS_BP_Vector , |
||
const Standard_Boolean | IsSimplePrs = Standard_False |
||
) |
|
virtual |
Builds vector data presentation.
Implements MeshVS_PrsBuilder.
|
static |
Calculates points of arrow presentation.
void MeshVS_VectorPrsBuilder::DrawVector | ( | const gp_Trsf & | theTrsf, |
const Standard_Real | Length, | ||
const Standard_Real | MaxLength, | ||
const TColgp_Array1OfPnt & | ArrowPoints, | ||
const Handle< Graphic3d_ArrayOfPrimitives > & | Lines, | ||
const Handle< Graphic3d_ArrayOfPrimitives > & | ArrowLines, | ||
const Handle< Graphic3d_ArrayOfPrimitives > & | Triangles | ||
) | const |
Adds to array of polygons and polylines some primitive representing single vector.
void MeshVS_VectorPrsBuilder::GetMinMaxVectorValue | ( | const Standard_Boolean | IsElement, |
Standard_Real & | MinValue, | ||
Standard_Real & | MaxValue | ||
) | const |
Calculates minimal and maximal length of vectors in map ( nodal, if IsElement = False or elemental, if IsElement = True )
Standard_Boolean MeshVS_VectorPrsBuilder::GetVector | ( | const Standard_Boolean | IsElement, |
const Standard_Integer | ID, | ||
gp_Vec & | Vect | ||
) | const |
Returns vector assigned with certain node or element.
const MeshVS_DataMapOfIntegerVector& MeshVS_VectorPrsBuilder::GetVectors | ( | const Standard_Boolean | IsElement | ) | const |
Returns map of vectors assigned with nodes or elements.
Standard_Boolean MeshVS_VectorPrsBuilder::HasVectors | ( | const Standard_Boolean | IsElement | ) | const |
Returns true, if map isn't empty.
void MeshVS_VectorPrsBuilder::SetSimplePrsMode | ( | const Standard_Boolean | IsSimpleArrow | ) |
Sets flag that indicates is simple vector arrow mode uses or not default value is False.
void MeshVS_VectorPrsBuilder::SetSimplePrsParams | ( | const Standard_Real | theLineWidthParam, |
const Standard_Real | theStartParam, | ||
const Standard_Real | theEndParam | ||
) |
Sets parameters of simple vector arrwo presentation theLineWidthParam - coefficient of vector line width (to draw line instead of arrow) theStartParam and theEndParam parameters of start and end of thickened ends position of thickening calculates according to parameters and maximum vector length default values are: theLineWidthParam = 2.5 theStartParam = 0.85 theEndParam = 0.95.
void MeshVS_VectorPrsBuilder::SetVector | ( | const Standard_Boolean | IsElement, |
const Standard_Integer | ID, | ||
const gp_Vec & | Vect | ||
) |
Sets vector assigned with certain node or element.
void MeshVS_VectorPrsBuilder::SetVectors | ( | const Standard_Boolean | IsElement, |
const MeshVS_DataMapOfIntegerVector & | Map | ||
) |
Sets map of vectors assigned with nodes or elements.