# Visualization
TKNIS
NIS

# NIS_Surface Class Reference

`#include <NIS_Surface.hxx>`

Inheritance diagram for NIS_Surface:

[legend]

## Public Member Functions

Standard_EXPORT | NIS_Surface (const Handle_Poly_Triangulation &theTri, const Handle_NCollection_BaseAllocator &theAlloc=0L)
Standard_EXPORT | NIS_Surface (const TopoDS_Shape &theShape, const Handle_NCollection_BaseAllocator &theAlloc=0L)
virtual Standard_EXPORT | ~NIS_Surface ()
Standard_Integer | NNodes () const
Standard_Integer | NTriangles () const
const Standard_ShortReal * | Node (const Standard_Integer theIndex) const
const Standard_Integer * | Triangle (const Standard_Integer theIndex) const
const Standard_ShortReal * | Normal (const Standard_Integer theIndex) const
virtual Standard_EXPORT Handle_NIS_Drawer | DefaultDrawer () const
Standard_EXPORT void | SetColor (const Quantity_Color &theColor)
Standard_EXPORT void | SetBackColor (const Quantity_Color &theColor)
Standard_EXPORT void | SetPolygonOffset (const Standard_Real theValue)
Standard_EXPORT void | SetTransparency (const Standard_Real theValue)
virtual Standard_EXPORT Standard_Real | Intersect (const gp_Ax1 &theAxis, const Standard_Real theOver) const
virtual Standard_EXPORT Standard_Boolean | Intersect (const Bnd_B3f &theBox, const gp_Trsf &theTrf, const Standard_Boolean isFull) const

## Protected Member Functions

virtual Standard_EXPORT void | computeBox ()
Standard_Boolean | computeNormal (Standard_Integer theIndex, gp_XYZ &theNormal) const

## Private Attributes

Standard_ShortReal * | mypNodes
| Array of nodes in triangles.
Standard_ShortReal * | mypNormals
| Array of normals (TriNodes).
Standard_Integer * | mypTriangles
Standard_Integer | myNNodes
| Number of nodes in triangles.
Standard_Integer | myNTriangles
Handle_NCollection_BaseAllocator | myAlloc

## Detailed Description

This class describes a presentation of a meshed surface.

## Constructor & Destructor Documentation

Standard_EXPORT NIS_Surface::NIS_Surface | ( | const Handle_Poly_Triangulation & | theTri,
|  | const Handle_NCollection_BaseAllocator & | theAlloc = `0L`
| ) |

| Constructor

Standard_EXPORT NIS_Surface::NIS_Surface | ( | const TopoDS_Shape & | theShape,
|  | const Handle_NCollection_BaseAllocator & | theAlloc = `0L`
| ) |

Constructor. Creates the presentation of all faces in 'theShape' object. theShape Source geometry. It should contain triangulations inside.

Parameters:

  | theAlloc | Allocator used for nodes and triangles in this presentation.

virtual Standard_EXPORT NIS_Surface::~NIS_Surface | ( |  | ) | `[virtual]`

| Destructor

## Member Function Documentation

virtual Standard_EXPORT void NIS_Surface::computeBox | ( |  | ) | `[protected, virtual]`

| Create a 3D bounding box of the object. Implements NIS_InteractiveObject.

Standard_Boolean NIS_Surface::computeNormal | ( | Standard_Integer | theIndex,
|  | gp_XYZ & | theNormal
| ) | const`[protected]`

| Compute normal to the surface at the node with the given index. Returns true if the vertex is artificial at this node.

virtual Standard_EXPORT Handle_NIS_Drawer NIS_Surface::DefaultDrawer | ( |  | ) | const`[virtual]`

| Create a default drawer instance. Implements NIS_InteractiveObject.

virtual Standard_EXPORT Standard_Boolean NIS_Surface::Intersect | ( | const Bnd_B3f & | theBox,
|  | const gp_Trsf & | theTrf,
|  | const Standard_Boolean | isFull
| ) | const`[virtual]`

Intersect the InteractiveObject geometry with an oriented box.

Parameters:

  | theBox | 3D box of selection
  | theTrf | Position/Orientation of the box.
  | isFull | True if full inclusion is required, False - if partial.

Returns:
  True if the InteractiveObject geometry intersects the box or is inside it

Reimplemented from NIS_InteractiveObject.

virtual Standard_EXPORT Standard_Real NIS_Surface::Intersect | ( | const gp_Ax1 & | theAxis,
|  | const Standard_Real | theOver
| ) | const`[virtual]`

Intersect the InteractiveObject geometry with a line/ray.

Parameters:

  | theAxis | The line or ray in 3D space.
  | theOver | Half-thickness of the selecting line - ignored.

Returns:
  If the return value is more than 0.1*RealLast() then no intersection is detected. Otherwise returns the coordinate of the nearest intersection on the ray. May be negative.

Implements NIS_InteractiveObject.

Standard_Integer NIS_Surface::NNodes | ( |  | ) | const`[inline]`

| Query the number of nodes.

const Standard_ShortReal* NIS_Surface::Node | ( | const Standard_Integer | theIndex | ) | const`[inline]`

Query the node by its index.

Returns:
  pointer to array of 3 Standard_ShortReal values (X,Y,Z coordinates)

const Standard_ShortReal* NIS_Surface::Normal | ( | const Standard_Integer | theIndex | ) | const`[inline]`

Query the normal vector at the given triangulation node (by index)

Returns:
  pointer to array of 3 Standard_ShortReal values (X,Y,Z coordinates)

Standard_Integer NIS_Surface::NTriangles | ( |  | ) | const`[inline]`

| Query the number of triangles.

Standard_EXPORT void NIS_Surface::SetBackColor | ( | const Quantity_Color & | theColor | ) |

Set the color for presentation of the back side of triangles.

Parameters:

  | theColor | New color to use for the presentation.

Standard_EXPORT void NIS_Surface::SetColor | ( | const Quantity_Color & | theColor | ) |

Set the normal color for presentation.

Parameters:

  | theColor | New color to use for the presentation.

Standard_EXPORT void NIS_Surface::SetPolygonOffset | ( | const Standard_Real | theValue | ) |

Set the offset for the presentation.

Parameters:

  | theValue | New offset to use for the presentation.

Standard_EXPORT void NIS_Surface::SetTransparency | ( | const Standard_Real | theValue | ) |

Set the transparency factor.

Parameters:

  | theValue | 1.0 means full transparency, 0.0 means opaque. Valid quantities are in this interval.

Reimplemented from NIS_InteractiveObject.

const Standard_Integer* NIS_Surface::Triangle | ( | const Standard_Integer | theIndex | ) | const`[inline]`

Query the triangle by its index.

Returns:
  pointer to array of 3 Standard_Integer values (nodes 0, 1, 2)

## Field Documentation

Handle_NCollection_BaseAllocator NIS_Surface::myAlloc `[private]`

Standard_Integer NIS_Surface::myNNodes `[private]`

Standard_Integer NIS_Surface::myNTriangles `[private]`

Standard_ShortReal* NIS_Surface::mypNodes `[private]`

Standard_ShortReal* NIS_Surface::mypNormals `[private]`

Standard_Integer* NIS_Surface::mypTriangles `[private]`

The documentation for this class was generated from the following file:

- NIS_Surface.hxx