Rhino C++ API  8.14
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ON_SIL_EVENT Class Reference

#include <opennurbs_plus_sil.h>

Public Types

enum  END_TYPE : unsigned int {
  kEndUnknown = 0, kEndBoundary = 1, kEndEdge = 2, kEndLoop = 3,
  kEndCusp = 4, kEndProjected = 5, kEndSection = 6, kEndSngularity = 7
}
 
enum  SIDE_FILL : unsigned int { kSideUnset = 0, kSideSurface = 1, kSideVoid = 2, kSideOtherSurface = 3 }
 
enum  TYPE : unsigned int {
  kNoSilEvent = 0, kSilProjecting = 1, kSilTanProject = 2, kSilTangent = 4,
  kSilCrease = 8, kSilBoundary = 16, kNonSilCrease = 256, kNonSilTangent = 512,
  kNonSilSeam = 1024, kSectionCut = 4096, kMiscFeature = 8192, kDraftCurve = 32768
}
 

Public Member Functions

enum TYPE unsigned int enum END_TYPE unsigned int ON_SIL_EVENT () ON_NOEXCEPT
 
 ON_SIL_EVENT (const ON_SIL_EVENT &rhs)
 
 ON_SIL_EVENT (TYPE ttype, ON_COMPONENT_INDEX cci, END_TYPE etype0, ON_COMPONENT_INDEX eci0, double p0, END_TYPE etype1, ON_COMPONENT_INDEX eci1, double p1, ON_Curve *c3d=nullptr, ON_Curve *c2d=nullptr) ON_NOEXCEPT
 
 ~ON_SIL_EVENT ()
 
void Dump (ON_TextLog &text_log) const
 
bool IsSilhouetteType () const
 
bool IsTangentSilhouetteType () const
 
ON_SIL_EVENToperator= (const ON_SIL_EVENT &rhs)
 

Static Public Member Functions

static bool IsSilhouetteType (TYPE)
 
static bool IsTangentSilhouetteType (TYPE)
 returns true for kSilProjecting through kSilTangent More...
 

Public Attributes

ON_COMPONENT_INDEX m_ci
 
ON_Curvem_curve2d
 parameter space curve if available or nullptr More...
 
ON_Curvem_curve3d
 These are deleted by ~ON_SIL_EVENT() More...
 
ON_COMPONENT_INDEX m_end_ci [2]
 
double m_end_parameter [2]
 
END_TYPE m_end_type [2]
 
SIDE_FILL m_side_fill [2]
 
TYPE m_type
 

Detailed Description

The ON_SIL_EVENT class is used to report silhouettes from functions such as ON_Brep::GetSilhouette(..)

Member Enumeration Documentation

◆ END_TYPE

enum ON_SIL_EVENT::END_TYPE : unsigned int

END_TYPE describes the endpoint of an ON_SIL_EVENT

Enumerator
kEndUnknown 
kEndBoundary 

end is on geometry boundary

kEndEdge 

end at a brep edge

kEndLoop 

TODO?? ( why this and kEndProjected ) end in on a projecting region loop.

kEndCusp 

This end is a silhouette cusp point. (i.e. The projected silhouette has a kink)

kEndProjected 

ends on a projected region loop

kEndSection 

ends at a section cut

kEndSngularity 

ends at a point where more than two ON_SIL_EVENTs may join together.

◆ SIDE_FILL

enum ON_SIL_EVENT::SIDE_FILL : unsigned int

When a silhouette is projected on the image plane ( determined by the camera location or direction), and projects to a curve (not a point), the image area to the left or right of a projected silhouette curve is filled with either the surface or a void.

Enumerator
kSideUnset 
kSideSurface 
kSideVoid 
kSideOtherSurface 

Not used for silhouette results but for ....

◆ TYPE

enum ON_SIL_EVENT::TYPE : unsigned int

Description: The types are ordered. The type of a ON_SIL_EVENT is reported as the lowest valued type that applies. For example, a boundary that is a tangent silhouette will be reported as kSilTangent type not a kSilBoundary.

Enumerator
kNoSilEvent 
kSilProjecting 

boundary of a region that projects to a curve.

kSilTanProject 

The view direction is tangent to the surface over the entire region.

tangent silhouette curve where the curve projects to a point( within tolerance)

kSilTangent 

in this case side_fill[i] is meaningless so it's left unset.

tangent silhouette curve.

kSilCrease 

The view direction is tangent to the surface along the curve.

crease on geometry that is a silhouette

kSilBoundary 

boundary of geometry is always a silhouette

kNonSilCrease 

non_sil_features

A geometry crease that is not a silhouette

kNonSilTangent 

A tangent edge that is not a silhouette.

kNonSilSeam 

A surface seam that is not a silhouette.

kSectionCut 

Intersection with a clipping plane, not produced by GetSilhouette(...) functions.

kMiscFeature 

Miscellaneous curve feature, used for curve objects in TL_HiddenLineDrawing.

kDraftCurve 

draft curve is a curve of constant draft angle.

Draft curves are produced when SetDraftCurve(..) is called on the ON_SilhouetteParameter.

Constructor & Destructor Documentation

◆ ON_SIL_EVENT() [1/3]

enum TYPE unsigned int enum END_TYPE unsigned int ON_SIL_EVENT::ON_SIL_EVENT ( )

◆ ON_SIL_EVENT() [2/3]

ON_SIL_EVENT::ON_SIL_EVENT ( TYPE  ttype,
ON_COMPONENT_INDEX  cci,
END_TYPE  etype0,
ON_COMPONENT_INDEX  eci0,
double  p0,
END_TYPE  etype1,
ON_COMPONENT_INDEX  eci1,
double  p1,
ON_Curve c3d = nullptr,
ON_Curve c2d = nullptr 
)

This constructor leaves m_side_fill[i]=unset but initializes all other fields. The lifetimes of c3d and/or c2d are managed by the ON_SIL_EVENT class.

◆ ON_SIL_EVENT() [3/3]

ON_SIL_EVENT::ON_SIL_EVENT ( const ON_SIL_EVENT rhs)

An ON_SIL_EVENT can own a pair of ON_Curves pointed to by m_curve2d and m_curve3d. So the copy constructor and operator= makes copies of these curves. And destructor ~ON_SIL_EVENT() deletes these curves.

◆ ~ON_SIL_EVENT()

ON_SIL_EVENT::~ON_SIL_EVENT ( )

Member Function Documentation

◆ Dump()

void ON_SIL_EVENT::Dump ( ON_TextLog text_log) const

◆ IsSilhouetteType() [1/2]

bool ON_SIL_EVENT::IsSilhouetteType ( ) const

◆ IsSilhouetteType() [2/2]

static bool ON_SIL_EVENT::IsSilhouetteType ( TYPE  )
static

IsSilhouetteType() returns true for types kSilProjecting through kSilBoundary.

◆ IsTangentSilhouetteType() [1/2]

bool ON_SIL_EVENT::IsTangentSilhouetteType ( ) const

◆ IsTangentSilhouetteType() [2/2]

static bool ON_SIL_EVENT::IsTangentSilhouetteType ( TYPE  )
static

returns true for kSilProjecting through kSilTangent

IsTangentSilhouetteType() returns true for types kSilProjecting through kSilTangent.

◆ operator=()

ON_SIL_EVENT& ON_SIL_EVENT::operator= ( const ON_SIL_EVENT rhs)

Member Data Documentation

◆ m_ci

ON_COMPONENT_INDEX ON_SIL_EVENT::m_ci

m_ci if valid, is the component index of geometry containing entire silhouette curve. A typical example is ON_SIL_EVENT that starts and ends on ON_BrepEdges and goes across the interior of face. In this case m_ci will be the component index of the face, m_end_ci[0] and m_end_ci[1] will be the component indices of the edges on which the ON_SIL_EVENT terminates, m_end_type[0] and m_end_type[1] will be either END_TYPE::kEndBoundary or END_TYPE::kEndEdge.

◆ m_curve2d

ON_Curve* ON_SIL_EVENT::m_curve2d

parameter space curve if available or nullptr

◆ m_curve3d

ON_Curve* ON_SIL_EVENT::m_curve3d

These are deleted by ~ON_SIL_EVENT()

◆ m_end_ci

ON_COMPONENT_INDEX ON_SIL_EVENT::m_end_ci[2]

m_end_ci[0], if valid, is the component index of geometry containing the ON_SIL_EVENT start point. Similarly m_end_ci[0] applies to the ON_SIL_EVENT end point.

◆ m_end_parameter

double ON_SIL_EVENT::m_end_parameter[2]

m_end_parameter[0] is the ON_Brep::Edge parameter of the ON_SIL_EVENT start point when m_end_type[0] = END_TYPE::kEndBoundary, or m_end_type[0] = END_TYPE::kEndEdge. m_end_parameter[0] similarly applies to the end point.

◆ m_end_type

END_TYPE ON_SIL_EVENT::m_end_type[2]

m_end_type[0] is the END_TYPE of the curve start and and m_end_type[1] is the END_TYPE of the curve end.

◆ m_side_fill

SIDE_FILL ON_SIL_EVENT::m_side_fill[2]

m_side_fill[0] defines how the region in the image plane to the left (or right for m_side_fill[1]) of the projected silhouette curve is filled.

Example: generally the surface locally lies to either the left or the right of the projected silhouette curve in the image plane. The basic degenerate cases are that of a projecting surface or the case of a silhouette with the surface on both sides of the silhouette locally m_side_fill[0] m_side_fill[1] Left Side side_surface side_void Right side_void side_surface

projecting side_void side_void degenerate side_surface side_surface

◆ m_type

TYPE ON_SIL_EVENT::m_type