Open CASCADE Technology
6.9.0
|
#include <NIS_Surface.hxx>
Public Types | |
enum | DisplayMode { Shading, Wireframe } |
Public Member Functions | |
NIS_Surface (const Handle< Poly_Triangulation > &theTri, const Handle< NCollection_BaseAllocator > &theAlloc=0L) | |
NIS_Surface (const TopoDS_Shape &theShape, const Standard_Real theDeflection, const Handle< NCollection_BaseAllocator > &theAl=0L) | |
virtual | ~NIS_Surface () |
void | Init (const TopoDS_Shape &theShape, const Standard_Real theDefl) |
void | Clear () |
Standard_Integer | NNodes () const |
Standard_Integer | NTriangles () const |
Standard_Integer | NEdges () const |
const Standard_ShortReal * | Node (const Standard_Integer theIndex) const |
const Standard_Integer * | Triangle (const Standard_Integer theIndex) const |
const Standard_Integer * | Edge (const Standard_Integer theIndex) const |
const Standard_ShortReal * | Normal (const Standard_Integer theIndex) const |
virtual NIS_Drawer * | DefaultDrawer (NIS_Drawer *) const |
void | SetColor (const Quantity_Color &theColor) |
void | SetBackColor (const Quantity_Color &theColor) |
void | SetPolygonOffset (const Standard_Real theValue) |
void | SetDisplayMode (const DisplayMode theMode) |
DisplayMode | GetDisplayMode () const |
virtual void | Clone (const Handle< NCollection_BaseAllocator > &theAll, Handle< NIS_InteractiveObject > &theDest) const |
virtual Standard_Real | Intersect (const gp_Ax1 &theAxis, const Standard_Real theOver) const |
virtual Standard_Boolean | Intersect (const Bnd_B3f &theBox, const gp_Trsf &theTrf, const Standard_Boolean isFull) const |
virtual Standard_Boolean | Intersect (const NCollection_List< gp_XY > &thePolygon, const gp_Trsf &theTrf, const Standard_Boolean isFullIn) const |
![]() | |
NIS_InteractiveObject () | |
virtual | ~NIS_InteractiveObject () |
Standard_Integer | ID () const |
NIS_Drawer::DrawType | DrawType () const |
const Handle< NIS_Drawer > & | SetDrawer (const Handle< NIS_Drawer > &theDrawer, const Standard_Boolean setUpdated=Standard_True) |
const Handle< NIS_Drawer > & | GetDrawer () const |
const Bnd_B3f & | GetBox () |
Standard_Boolean | IsTransparent () const |
Standard_Boolean | IsHidden () const |
Standard_Boolean | IsDisplayed () const |
Standard_Boolean | IsDynHilighted () const |
virtual Standard_Boolean | IsSelectable () const |
virtual void | SetSelectable (const Standard_Boolean isSel=Standard_True) const |
Standard_ShortReal | Transparency () const |
void | SetTransparency (const Standard_Real theValue=0.6) |
void | UnsetTransparency () |
void | CloneWithID (const Handle< NCollection_BaseAllocator > &, Handle< NIS_InteractiveObject > &) |
void | SetAttribute (void *theAttributePtr) |
void * | GetAttribute () const |
![]() | |
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 | Delete () const |
Memory deallocator for transient classes. 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... | |
Protected Member Functions | |
NIS_Surface (const Handle< NCollection_BaseAllocator > &theAl) | |
virtual void | computeBox () |
Standard_Boolean | computeNormal (Standard_Integer theIndex, gp_XYZ &theNormal) const |
![]() | |
void | setDrawerUpdate () const |
Standard_Boolean | isUpdateBox () const |
void | setIsUpdateBox (const Standard_Boolean isUpdate) |
Additional Inherited Members | |
![]() | |
Bnd_B3f | myBox |
void * | myAttributePtr |
Presentation of a meshed surface. Consists of 4 arrays: Nodes, Triangles, Normals and Edges. Normals are defined in nodes, so the number of stored normals is strictly the number of nodes. Edges is an array of pointers: each pointer starts an array of node indices that define a single edge (i.e., a polygon that can be closed or open, no matter). The first number in the edge is the number of nodes in it.
Instances of this class can be initialized either atomically (setting every node and triangle and edge) or from a TopoDS_Shape object. In side the TopoDS_Shape only triangulations in faces are used; edges are taken from PolygonOnTriangulation also belonging to faces.
This class is conceived as replacement of AIS_Shape; both wireframe and shading modes are available for dynamic switching.
NIS_Surface::NIS_Surface | ( | const Handle< Poly_Triangulation > & | theTri, |
const Handle< NCollection_BaseAllocator > & | theAlloc = 0L |
||
) |
Constructor
NIS_Surface::NIS_Surface | ( | const TopoDS_Shape & | theShape, |
const Standard_Real | theDeflection, | ||
const Handle< NCollection_BaseAllocator > & | theAl = 0L |
||
) |
Constructor. Creates the presentation of all faces in 'theShape' object.
theShape | Source geometry. It should contain triangulations inside. |
theDeflection | Absolute deflection for meshing 'theShape' if such meshing is needed. |
theAl | Allocator used for nodes and triangles in this presentation. |
|
virtual |
Destructor
|
protected |
Allocator for method Clone().
void NIS_Surface::Clear | ( | ) |
Deallocate all internal data structures.
|
virtual |
Create a copy of theObject except its ID.
theAll | Allocator where the Dest should store its private data. |
theDest | [in-out] The target object where the data are copied. If passed NULL then the target should be created. |
Reimplemented from NIS_InteractiveObject.
|
protectedvirtual |
Create a 3D bounding box of the object.
Implements NIS_InteractiveObject.
|
protected |
Compute normal to the surface at the node with the given index. Returns true if the vertex is artificial at this node.
|
virtual |
Create a default drawer instance.
Implements NIS_InteractiveObject.
|
inline |
Access to array of integers that represents an Edge.
DisplayMode NIS_Surface::GetDisplayMode | ( | ) | const |
Query the current display mode: Shading or Wireframe.
void NIS_Surface::Init | ( | const TopoDS_Shape & | theShape, |
const Standard_Real | theDefl | ||
) |
Initialize the instance with a TopoDS_Shape. Used in constructor but can be called any time to redefine the geometry.
|
virtual |
Intersect the surface shading/wireframe geometry with a line/ray.
theAxis | The line or ray in 3D space. |
theOver | Half-thickness of the selecting line - ignored. |
Implements NIS_InteractiveObject.
|
virtual |
Intersect the surface shading/wireframe geometry with an oriented box.
theBox | 3D box of selection |
theTrf | Position/Orientation of the box. |
isFull | True if full inclusion is required, False - if partial. |
Reimplemented from NIS_InteractiveObject.
|
virtual |
Intersect the surface shading/wireframe geometry with a selection polygon.
thePolygon | the list of vertices of a free-form closed polygon without self-intersections. The last point should not coincide with the first point of the list. Any two neighbor points should not be confused. |
theTrf | Position/Orientation of the polygon. |
isFullIn | True if full inclusion is required, False - if partial. |
Reimplemented from NIS_InteractiveObject.
|
inline |
Query the number of edges for wireframe display.
|
inline |
Query the number of nodes.
|
inline |
Query the node by its index.
|
inline |
Query the normal vector at the given triangulation node (by index)
|
inline |
Query the number of triangles.
void NIS_Surface::SetBackColor | ( | const Quantity_Color & | theColor | ) |
Set the color for presentation of the back side of triangles.
theColor | New color to use for the presentation. |
void NIS_Surface::SetColor | ( | const Quantity_Color & | theColor | ) |
Set the normal color for presentation.
theColor | New color to use for the presentation. |
void NIS_Surface::SetDisplayMode | ( | const DisplayMode | theMode | ) |
Set the display mode: Shading or Wireframe. The default mode is Shading.
void NIS_Surface::SetPolygonOffset | ( | const Standard_Real | theValue | ) |
Set the offset for the presentation.
theValue | New offset to use for the presentation. |
|
inline |
Query the triangle by its index.