Rhino C++ API
7.26
|
#include <opennurbs_subd.h>
Public Types | |
enum | : unsigned int { MaximumFaceCount = 0xFFF0U } |
Public Member Functions | |
ON_SubDEdge ()=default | |
ON_SubDEdge (const ON_SubDEdge &)=default | |
~ON_SubDEdge ()=default | |
bool | AddFaceToArray (ON_SubDFacePtr face_ptr) |
const ON_SubDEdge * | AdjacentEdge (unsigned int edge_vertex_index, unsigned int i) const |
const ON_SubDEdgePtr | AdjacentEdgePtr (unsigned int edge_vertex_index, unsigned int i) const |
const ON_BoundingBox | BoundingBox (ON_SubDComponentLocation subd_appearance, const ON_SubD &subd) const |
const ON_Plane | CenterFrame (ON_SubDComponentLocation subd_appearance) const |
const ON_3dVector | CenterNormal (ON_SubDComponentLocation subd_appearance, unsigned int edge_face_index) const |
const ON_3dPoint | CenterPoint (ON_SubDComponentLocation subd_appearance) const |
void | ClearSavedSubdivisionPoints () const |
void | ClearSavedSubdivisionPoints (bool bClearNeighborhood) const |
const ON_COMPONENT_INDEX | ComponentIndex () const |
const ON_SubDComponentPtr | ComponentPtr () const |
const ON_BoundingBox | ControlNetBoundingBox () const |
const ON_3dVector | ControlNetCenterNormal (unsigned int edge_face_index) const |
const ON_3dPoint | ControlNetCenterPoint () const |
const ON_3dVector | ControlNetDirection () const |
const ON_3dVector | ControlNetDirectionFrom (const ON_SubDVertex *v) const |
const ON_Line | ControlNetLine () const |
const ON_3dPoint | ControlNetPoint (unsigned int i) const |
unsigned int | DartCount () const |
unsigned int | EdgeAttributes () const |
unsigned int | EdgeId () const |
void | EdgeModifiedNofification () const |
ON_NurbsCurve * | EdgeSurfaceCurve (bool bClampEndKnots, ON_NurbsCurve *destination_curve) const |
bool | EdgeSurfaceCurveIsSet () const |
bool | EvaluateCatmullClarkSubdivisionPoint (double subdivision_point[3]) const |
const class ON_SubDFace * | Face (unsigned int i) const |
unsigned int | FaceArrayIndex (const class ON_SubDFace *f) const |
unsigned int | FaceCount () const |
ON__UINT_PTR | FaceDirection (unsigned int i) const |
const ON_SubDFacePtr | FacePtr (unsigned int i) const |
const ON_SubDFacePtr | FacePtrFromFace (const class ON_SubDFace *f) const |
bool | GetCenterPointAndNormal (ON_SubDComponentLocation subd_appearance, unsigned int edge_face_index, double *P, double *N) const |
unsigned int | GetEdgeSurfaceCurveControlPoints (ON_3dPoint *cvs, size_t cv_capacity) const |
unsigned int | GetSectorBoundaryEdges (unsigned int edge_vertex_index, ON_SubDEdgePtr *edge_ptr0, ON_SubDEdgePtr *edge_ptr1) const |
bool | GetSubdivisionPoint (double subdivision_point[3]) const |
bool | GetSurfaceCenterPointAndNormal (unsigned int edge_face_index, double *P, double *N) const |
unsigned int | GetSurfaceMeshFragmentPoints (ON_3dPoint *P, size_t P_capacity) const |
bool | HasBoundaryEdgeTopology () const |
bool | HasInteriorEdgeTopology (bool bRequireOppositeFaceDirections) const |
bool | IsCrease () const |
bool | IsDartCrease () const |
bool | IsHardCrease () const |
bool | IsSmooth () const |
bool | IsSmoothNotX () const |
bool | IsSmoothX () const |
unsigned int | MarkedFaceCount () const |
unsigned int | MarkedVertexCount () const |
const ON_SubDFace * | NeighborFace (const ON_SubDFace *face, bool bStopAtCrease) const |
const ON_SubDFacePtr | NeighborFacePtr (const ON_SubDFace *face, bool bStopAtCrease) const |
const ON_ComponentStatus | NeighborhoodStatusLogicalOr (bool bIncludeVertices, bool bIncludeFaces) const |
ON_SubDEdge & | operator= (const ON_SubDEdge &)=default |
const class ON_SubDVertex * | OtherEndVertex (const class ON_SubDVertex *vertex) const |
bool | RemoveFaceFromArray (const ON_SubDFace *f) |
bool | RemoveFaceFromArray (unsigned int i, ON_SubDFacePtr &removed_face) |
unsigned int | ReplaceFaceInArray (const ON_SubDFace *old_face, const ON_SubDFace *new_face) |
const ON_3dPoint | SubdivisionPoint () const |
const ON_BoundingBox | SurfaceBoundingBox (const ON_SubD &subd) const |
const ON_3dVector | SurfaceCenterNormal (unsigned int edge_face_index) const |
const ON_3dPoint | SurfaceCenterPoint () const |
unsigned int | TaggedEndIndex () const |
bool | Transform (bool bTransformationSavedSubdivisionPoint, const class ON_Xform &xform) |
void | UnsetSectorCoefficientsForExperts () const |
bool | UpdateEdgeSectorCoefficientsForExperts (bool bUnsetEdgeSectorCoefficientsOnly) const |
const class ON_SubDVertex * | Vertex (unsigned evi) const |
unsigned int | VertexArrayIndex (const class ON_SubDVertex *v) const |
unsigned int | VertexCount () const |
unsigned int | VertexId (unsigned evi) const |
bool | Write (class ON_BinaryArchive &archive) const |
![]() | |
ON_SubDComponentBase ()=default | |
ON_SubDComponentBase (const ON_SubDComponentBase &)=default | |
~ON_SubDComponentBase ()=default | |
unsigned int | ArchiveId () const |
bool | ClearMark () const |
ON__UINT8 | ClearMarkBits () const |
void | ClearSavedSubdivisionPoint () const |
void | ClearSubdivisionDisplacement () const |
bool | GetSavedSubdivisionPoint (double subdivision_point[3]) const |
bool | GetSubdivisionDisplacement (double *) const |
bool | InSymmetrySet () const |
bool | IsActive () const |
bool | IsSymmetrySetPrimaryMotif () const |
bool | Mark () const |
ON__UINT8 | MarkBits () const |
ON_SubDComponentBase & | operator= (const ON_SubDComponentBase &)=default |
const ON_3dPoint | SavedSubdivisionPoint () const |
bool | SavedSubdivisionPointIsSet () const |
void | SetArchiveId (unsigned int archive_id) const |
bool | SetMark () const |
bool | SetMark (bool bMark) const |
ON__UINT8 | SetMarkBits (ON__UINT8 mark_bits) const |
bool | SetSavedSubdivisionPoint (const double subdivision_point[3]) const |
bool | SetSubdivisionDisplacement (const double *) |
void | SetSubdivisionLevel (unsigned level) |
const ON_ComponentStatus | Status () const |
const ON_3dVector | SubdivisionDisplacement () const |
bool | SubdivisionDisplacementIsNonzero () const |
const unsigned | SubdivisionLevel () const |
Static Public Member Functions | |
static const ON_SubDEdgePtr | FromVertices (const ON_SubDVertex *vertex0, const ON_SubDVertex *vertex1) |
static const ON_SubDEdge * | FromVertices (const ON_SubDVertex *vertex0, const ON_SubDVertex *vertex1, bool bIgnoreOrientation) |
static bool | Read (class ON_BinaryArchive &archive, class ON_SubD &subd, class ON_SubDEdge *&edge) |
![]() | |
static int | CompareId (const ON_SubDComponentBase *lhs, const ON_SubDComponentBase *rhs) |
Public Attributes | |
ON_SubDEdgeTag | m_edge_tag = ON_SubDEdgeTag::Unset |
ON_SubDFacePtr | m_face2 [2] = {} |
unsigned short | m_face_count = 0 |
ON_SubDFacePtr * | m_facex = nullptr |
unsigned short | m_facex_capacity = 0 |
const class ON_SubDEdge * | m_next_edge = nullptr |
linked list of edges on this level More... | |
const class ON_SubDEdge * | m_prev_edge = nullptr |
m_prev_edge, m_next_edge must be the first data members of ON_SubDEdge More... | |
double | m_sector_coefficient [2] = {} |
double | m_sharpness = 0.0 |
const class ON_SubDVertex * | m_vertex [2] = {} |
![]() | |
unsigned int | m_group_id = 0U |
unsigned int | m_id = 0 |
ON_ComponentStatus | m_status = ON_ComponentStatus::NoneSet |
const class ON_SubDVertex * | m_subd_point1 = nullptr |
Static Public Attributes | |
static const ON_SubDEdge | Empty |
![]() | |
static const ON_SubDComponentBase | Unset |
Friends | |
class | ON_Internal_SubDFaceMeshFragmentAccumulator |
class | ON_SubDArchiveIdMap |
class | ON_SubDFace |
class | ON_SubDHeap |
class | ON_SubDVertex |
Additional Inherited Members | |
![]() | |
enum | ModifiedFlags : unsigned char { Modified1Bit = 0x01, Modified2Bit = 0x02, ModifiedFlagsMask = 0x03 } |
enum | SavedPointsFlags : unsigned char { SubdivisionPointBit = 0x40, SurfacePointBit = 0x80, CachedPointMask = 0xC0 } |
![]() | |
void | CopyBaseFrom (const ON_SubDComponentBase *src, bool bCopySymmetrySetNext) |
void | Internal_ClearModifiedFlags () const |
void | Internal_ClearSubdivisionPointAndSurfacePointFlags () const |
void | Internal_ClearSubdivisionPointFlag () const |
void | Internal_ClearSurfacePointFlag () const |
bool | Internal_Modified1IsSet () const |
bool | Internal_Modified1or2IsSet () const |
void | Internal_SetModified1Flag () const |
void | Internal_SetModified2Flag () const |
void | Internal_SetSavedSurfacePointFlag (bool bSavedSurfacePointFlag) const |
bool | Internal_SubdivisionPointFlag () const |
bool | Internal_SurfacePointFlag () const |
void | Internal_TransformComponentBase (bool bTransformationSavedSubdivisionPoint, const class ON_Xform &xform) |
![]() | |
unsigned char | m_level = 0U |
unsigned char | m_saved_points_flags = 0U |
double | m_saved_subd_point1 [3] |
GetSubdivisionPoint( bUseSavedSubdivisionPoint=true ) can change the value of m_cache_subd_P. More... | |
anonymous enum : unsigned int |
Array of m_face_count faces.
The first two are in m_face2[0] and m_face2[1]. When m_face_count > 3, the third and additional faces are in m_facex[0], ..., m_facex[m_face_count-3];
The value of ON_SubDFacePtr.FaceDirection() is 0 if the edge's natural orientation from m_vertex[0] to m_vertex[1] agrees with the face's boundary orientation.
The value of ON_SubDFacePtr.FaceDirection() is 1 if the edge's natural orientation from m_vertex[0] to m_vertex[1] is opposited the face's boundary orientation.
Enumerator | |
---|---|
MaximumFaceCount |
|
default |
|
default |
|
default |
bool ON_SubDEdge::AddFaceToArray | ( | ON_SubDFacePtr | face_ptr | ) |
Description: Expert user tool to add a face from the edges's face array. Remarks: Does not modify the face. If the edge is not referenced in the face's edge array, then the edge must be inserted in the correct location in the faces array. If you are creating a non-manifold SubD, you must first reserve m_facex[] capacity by calling ON_SubD::GrowEdgeFaceArray().
const ON_SubDEdge* ON_SubDEdge::AdjacentEdge | ( | unsigned int | edge_vertex_index, |
unsigned int | i | ||
) | const |
const ON_SubDEdgePtr ON_SubDEdge::AdjacentEdgePtr | ( | unsigned int | edge_vertex_index, |
unsigned int | i | ||
) | const |
Parameters: edge_vertex_index - [in] 0 or 1 identifying which end of this edge to check. i - [in] Index of the face in this edge's face array. Returns: The edge adjacent to this edge in this->Face(i). The orientation is with respect to this->Face(i).
const ON_BoundingBox ON_SubDEdge::BoundingBox | ( | ON_SubDComponentLocation | subd_appearance, |
const ON_SubD & | subd | ||
) | const |
const ON_Plane ON_SubDEdge::CenterFrame | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
const ON_3dVector ON_SubDEdge::CenterNormal | ( | ON_SubDComponentLocation | subd_appearance, |
unsigned int | edge_face_index | ||
) | const |
const ON_3dPoint ON_SubDEdge::CenterPoint | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
void ON_SubDEdge::ClearSavedSubdivisionPoints | ( | ) | const |
Description: Clears saved subdivision and limit surface information for this edge. Attached vertices and faces are not modifed.
void ON_SubDEdge::ClearSavedSubdivisionPoints | ( | bool | bClearNeighborhood | ) | const |
Description: Clears saved subdivision and limit surface information for this edge. Parameters: bClearNeighborhood - [in] If true, all vertices and faces attached to this edge are also cleared.
const ON_COMPONENT_INDEX ON_SubDEdge::ComponentIndex | ( | ) | const |
const ON_SubDComponentPtr ON_SubDEdge::ComponentPtr | ( | ) | const |
const ON_BoundingBox ON_SubDEdge::ControlNetBoundingBox | ( | ) | const |
const ON_3dVector ON_SubDEdge::ControlNetCenterNormal | ( | unsigned int | edge_face_index | ) | const |
const ON_3dPoint ON_SubDEdge::ControlNetCenterPoint | ( | ) | const |
const ON_3dVector ON_SubDEdge::ControlNetDirection | ( | ) | const |
Returns: If vertices are set, then the vector from m_vertex[0]->ControlNetPoint() to m_vertex[1]->ControlNetPoint() is returned. Otherwise ON_3dVector::NanVector is returned.
const ON_3dVector ON_SubDEdge::ControlNetDirectionFrom | ( | const ON_SubDVertex * | v | ) | const |
Returns: If vertices are set and v is an end of the edge, then the vector from v to OtherEndVertex(v) is returned. Otherwise ON_3dVector::NanVector is returned.
const ON_Line ON_SubDEdge::ControlNetLine | ( | ) | const |
const ON_3dPoint ON_SubDEdge::ControlNetPoint | ( | unsigned int | i | ) | const |
Parameters: i - [in] 0 or 1. Returns: If i is 0 or 1 and vertex[i] is set, then vertex[i]->ControlNetPoint() is returned. Otherwise ON_3dPoint::NanPoint is returned.
unsigned int ON_SubDEdge::DartCount | ( | ) | const |
Returns: 0: end vertices are not tagged as darts 1: one end vertex is tagged as a dart. 2: both end vertices are tagged as a darts.
unsigned int ON_SubDEdge::EdgeAttributes | ( | ) | const |
Returns: bitwise or of applicable ON_ComponentAttributes::EdgeAttributes values. Remarks: ON_ComponentAttributes::EdgeAttributes has subsets of mutually exclusive edge attributes. If the edge is valid, then exactly one bit from each mutually exclusive set of properties will be set. If an edge is not valie, then all bits for a set may be clear. For example, if the edge has nullptr values in m_vertex[] or the vertex control point locations are unset or nan, then neither the ON_ComponentAttributes::EdgeAttributes::Open bit nor ON_ComponentAttributes::EdgeAttributes::Closed bit will be set.
unsigned int ON_SubDEdge::EdgeId | ( | ) | const |
void ON_SubDEdge::EdgeModifiedNofification | ( | ) | const |
Description: Call this function if the edge is modified and it will clear any cached subdivision information that needs to be recalculated.
ON_NurbsCurve* ON_SubDEdge::EdgeSurfaceCurve | ( | bool | bClampEndKnots, |
ON_NurbsCurve * | destination_curve | ||
) | const |
bool ON_SubDEdge::EdgeSurfaceCurveIsSet | ( | ) | const |
bool ON_SubDEdge::EvaluateCatmullClarkSubdivisionPoint | ( | double | subdivision_point[3] | ) | const |
Description: Evaluates the Catmull-Clark subdivision point ignoring all cached information. This function is typically used in testing and debugging code and in ordinary cases, it is faster and better to call SubdivisionPoint() or GetSubdivisionPoint(). Parameters: subdivision_point - [out] The edge Catmull-Clark subdivision point is returned here.
const class ON_SubDFace* ON_SubDEdge::Face | ( | unsigned int | i | ) | const |
unsigned int ON_SubDEdge::FaceArrayIndex | ( | const class ON_SubDFace * | f | ) | const |
unsigned int ON_SubDEdge::FaceCount | ( | ) | const |
ON__UINT_PTR ON_SubDEdge::FaceDirection | ( | unsigned int | i | ) | const |
const ON_SubDFacePtr ON_SubDEdge::FacePtr | ( | unsigned int | i | ) | const |
const ON_SubDFacePtr ON_SubDEdge::FacePtrFromFace | ( | const class ON_SubDFace * | f | ) | const |
|
static |
|
static |
Parameters: vertex0 - [in] vertex1 - [in] bIgnoreOrientation - [in] If false, then the returned edge must have vertices (vertex0, vertex1). If true, then the returned edge may have vertices (vertex0, vertex1) or (vertex1, vertex0). Returns: If an edge connects the input vertices, it is returned. Otherwise nullptr is returned.
bool ON_SubDEdge::GetCenterPointAndNormal | ( | ON_SubDComponentLocation | subd_appearance, |
unsigned int | edge_face_index, | ||
double * | P, | ||
double * | N | ||
) | const |
unsigned int ON_SubDEdge::GetEdgeSurfaceCurveControlPoints | ( | ON_3dPoint * | cvs, |
size_t | cv_capacity | ||
) | const |
Returns: 0 - failed. 4, 5, 7, 11: Number of cvs for a cubic uniform nonrational NURBS curve with (cv_count+2) knots = (-2,-1,0,1,2,3,4,5,6,7,8,9,10). Remarks: For exceptional cases,
unsigned int ON_SubDEdge::GetSectorBoundaryEdges | ( | unsigned int | edge_vertex_index, |
ON_SubDEdgePtr * | edge_ptr0, | ||
ON_SubDEdgePtr * | edge_ptr1 | ||
) | const |
Parameters: edge_vertex_index - [in] 0 or 1 edge_ptr0 - [out] edge_ptr1 - [out] Crease edges that bound the sector containing this edge. The direction value of the edge pointer identifies the end of the sector boundary edge this->at m_vertex[edge_vertex_index]. Returns: Number of faces in the sector.
bool ON_SubDEdge::GetSubdivisionPoint | ( | double | subdivision_point[3] | ) | const |
Parameters: bUseSavedSubdivisionPoint - [in] If there is a saved subdivision point and bUseSavedSubdivisionPoint is true, then the saved value is returned. subdivision_point - [out] Returns: true if successful summary> The SubD edge Catmull-Clark subdivision point. /summary>
bool ON_SubDEdge::GetSurfaceCenterPointAndNormal | ( | unsigned int | edge_face_index, |
double * | P, | ||
double * | N | ||
) | const |
Description: Get the limit surface point location and normal for the edge's midpoint from the limit mesh grid. Parameters: edge - [in] An edge in this SubD. edge_face_index - [in] Index of the face to use for the normal. If the edge is a crease, then each attached face may have a different normal. Pass 0 when in doubt. P - [out] P = limit surface location or ON_3dPoint::NanPoint if not available. N - [out] N = limit surface unit normal or ON_3dVector::NanVector if not available. Returns: True if the point and normal were set from the limit mesh frament. False if the limit mesh fragment was not found and nan values were returned. Remarks: Requires information created by ON_SubD::UpdateSurfaceMeshCache()
unsigned int ON_SubDEdge::GetSurfaceMeshFragmentPoints | ( | ON_3dPoint * | P, |
size_t | P_capacity | ||
) | const |
Description: Gets the limit esh fragment points for the edge. Parameters: P_capacity - [in] If input 0 = P_capacity, the required capacity is returned, otherwise P_capacity is the capacity of the P[] array P - [out] When P_capacity > 0, the points are returned here. Returns: Number of returned points (0,2,5,5,9,17,33,65)
bool ON_SubDEdge::HasBoundaryEdgeTopology | ( | ) | const |
Parameters: bRequireSameFaceOrientation - [in] If true, the attached faces must use the edge with opposite directions (oriented manifold). Returns: True if the edge has two distinct faces.
bool ON_SubDEdge::HasInteriorEdgeTopology | ( | bool | bRequireOppositeFaceDirections | ) | const |
Parameters: bRequireSameFaceOrientation - [in] If true, the attached faces must use the edge with opposite directions (oriented manifold). Returns: True if the edge has two distinct faces.
bool ON_SubDEdge::IsCrease | ( | ) | const |
Returns: True if m_edge_tag is ON_SubDEdgeTag::Crease.
bool ON_SubDEdge::IsDartCrease | ( | ) | const |
Returns: True if m_edge_tag is ON_SubDEdgeTag::Crease and at least one of its end vertices are tagged as ON_SubDVertexTag::Dart.
bool ON_SubDEdge::IsHardCrease | ( | ) | const |
Returns: True if m_edge_tag is ON_SubDEdgeTag::Crease and both of its end vertices are tagged as ON_SubDVertexTag::Crease, or ON_SubDVertexTag::Corner.
bool ON_SubDEdge::IsSmooth | ( | ) | const |
Returns: True if m_edge_tag is ON_SubDEdgeTag::Smooth or ON_SubDEdgeTag::SmoothX. False in all other cases.
bool ON_SubDEdge::IsSmoothNotX | ( | ) | const |
Returns: True if m_edge_tag is ON_SubDEdgeTag::Smooth. Remarks: Expert user function. This is used in rare cases when level 0 edges tagged as ON_SubDEdgeTag::SmoothX need special handling in low level evaluation code. Typical SDK level functions and anything related to runtime user interface should call IsSmooth().
bool ON_SubDEdge::IsSmoothX | ( | ) | const |
Returns: True if m_edge_tag is ON_SubDEdgeTag::SmoothX. Remarks: Expert user function. This is used in rare cases when level 0 edges tagged as ON_SubDEdgeTag::SmoothX need special handling in low level evaluation code. Typical SDK level functions and anything related to runtime user interface should call IsSmooth(). An edge tagged as "X" can occur at level 0. It is subdivided as a smooth vertex and both of its end vertices are tagged as ON_SubDVertexTag::Crease, ON_SubDVertexTag::Corner, or ON_SubDVertexTag::Dart. This tag cannot appear at level N with N >= 1.
unsigned int ON_SubDEdge::MarkedFaceCount | ( | ) | const |
Returns: Number of faces attached to this edge with Face().m_status.RuntimeMark() = true;
unsigned int ON_SubDEdge::MarkedVertexCount | ( | ) | const |
Returns: Number of end vertices with Vertex().m_status.RuntimeMark() = true;
const ON_SubDFace* ON_SubDEdge::NeighborFace | ( | const ON_SubDFace * | face, |
bool | bStopAtCrease | ||
) | const |
Description: Return the neighboring face. Parameters: face - [in] A face referenced in the edge's m_face2[] array. bStopAtCrease - [in] If true and if m_edge_tag = ON_SubDEdgeTag::Crease, then nullptr is returned. Returns: If the m_face_count = 2, m_edge_tag is smooth or x or passes the crease tag test, one of m_face2[0,1] points a face, then the neighboring face is returned. In any other case, nullptr is returned.
const ON_SubDFacePtr ON_SubDEdge::NeighborFacePtr | ( | const ON_SubDFace * | face, |
bool | bStopAtCrease | ||
) | const |
Description: Return the neighboring face. Parameters: face - [in] A face referenced in the edge's m_face2[] array. bStopAtCrease - [in] If true and if m_edge_tag = ON_SubDEdgeTag::Crease, then nullptr is returned. Returns: If the m_face_count = 2, m_edge_tag is smooth or x or passes the crease tag test, one of m_face2[0,1] points a face, then the neighboring face is returned. In any other case, ON_SubDFacePtr::Null is returned.
const ON_ComponentStatus ON_SubDEdge::NeighborhoodStatusLogicalOr | ( | bool | bIncludeVertices, |
bool | bIncludeFaces | ||
) | const |
Parameters: bIncludeVertices - [in] If true, then attached vertices are included. bIncludeFaces - [in] If true, then attached faces are included. Returns: A ON_ComponentStatusLogicalOr() of this vertex's status and the specified attached components. See Also: ON_SubDComponentBase::Status()
|
default |
const class ON_SubDVertex* ON_SubDEdge::OtherEndVertex | ( | const class ON_SubDVertex * | vertex | ) | const |
Description: Return the vertex at the other end of the edge. Parameters: vertex - [in] A vertex referenced in the edge's m_vertex[] array. Returns: If vertex is not nullptr and exactly one of m_vertex[] is equal to vertex, then the other m_vertex[] pointer is returned. In any other case, nullptr is returned. See Also: ON_SubDEdge.NeighborFace()
|
static |
bool ON_SubDEdge::RemoveFaceFromArray | ( | const ON_SubDFace * | f | ) |
Description: Expert user tool to remove a face from the edges's face array. Remarks: Does not modify the face. If the edge is referenced in the face's edge array, then the edge must be removed from the face's edge array.
bool ON_SubDEdge::RemoveFaceFromArray | ( | unsigned int | i, |
ON_SubDFacePtr & | removed_face | ||
) |
Description: Expert user tool to remove a face from the edges's face array. Remarks: Does not modify the face. If the edge is referenced in the face's edge array, then the edge must be removed from the face's edge array.
unsigned int ON_SubDEdge::ReplaceFaceInArray | ( | const ON_SubDFace * | old_face, |
const ON_SubDFace * | new_face | ||
) |
Description: Expert user tool to replace reference to old_face with a reference to new_face. Existing orientation is copied. No changes are made to old_face and new_face and their edge references must be updated accordingly. Parameters: old_face = [in] Cannot be nullptr. new_face = [in] If new_face is nullptr, old_face is simply removed. Returns: If the replacement was successful, then the m_faces[] array index where old_face/new_face replacement occured is returned. Otherwise ON_UNSET_UINT_INDEX is returned. Remarks: No modifications are made to old_face or new_face.
const ON_3dPoint ON_SubDEdge::SubdivisionPoint | ( | ) | const |
const ON_BoundingBox ON_SubDEdge::SurfaceBoundingBox | ( | const ON_SubD & | subd | ) | const |
const ON_3dVector ON_SubDEdge::SurfaceCenterNormal | ( | unsigned int | edge_face_index | ) | const |
Description: Get the limit surface point location and normal for the edge's midpoint from the limit mesh grid. Parameters: edge - [in] An edge in this SubD. edge_face_index - [in] Index of the face to use for the normal. If the edge is a crease, then each attached face may have a different normal. Pass 0 when in doubt. Returns: A unit normal or ON_3dVector::NanVector if information is not available. Remarks: Requires information created by ON_SubD::UpdateSurfaceMeshCache()
const ON_3dPoint ON_SubDEdge::SurfaceCenterPoint | ( | ) | const |
unsigned int ON_SubDEdge::TaggedEndIndex | ( | ) | const |
Returns: Set bTagged[i] = m_vertex[0]->IsDartOrCreaseOrCorner(). 0: bTagged[0] is true and bTagged[1] is false. 1: bTagged[0] is false and bTagged[1] is true. 2: bTagged[0] and Tagged[1] are both true. 3: bTagged[0] and Tagged[1] are both false.
bool ON_SubDEdge::Transform | ( | bool | bTransformationSavedSubdivisionPoint, |
const class ON_Xform & | xform | ||
) |
Description: Apply a tranxfomration matrix to vertex geometry information.
Parameters: bTransformationSavedSubdivisionPoint - [in] If the transformation is being applied to every vertex, edge and face in every level of a subdivision object, and the transformation is an isometry (rotation, translation, ...), a uniform scale, or a composition of these types, then set bTransformationSavedSubdivisionPoint = true to apply the transformation to saved subdivision and saved limit point information. In all other cases, set bTransformationSavedSubdivisionPoint = false and any saved subdivision points or saved limit points will be deleted. When in doubt, pass false.
xform - [in]
void ON_SubDEdge::UnsetSectorCoefficientsForExperts | ( | ) | const |
Description: Expert user tool to unset sector coefficients.
bool ON_SubDEdge::UpdateEdgeSectorCoefficientsForExperts | ( | bool | bUnsetEdgeSectorCoefficientsOnly | ) | const |
Description: Expert user tool to set mutable sector coefficients. Returns: True if values were modified.
const class ON_SubDVertex* ON_SubDEdge::Vertex | ( | unsigned | evi | ) | const |
Parameters: evi - [in] 0 or 1 Returns: If evi is 0 or 1, then m_vertex[evi] is returned. Otherwise nullptr is returned.
unsigned int ON_SubDEdge::VertexArrayIndex | ( | const class ON_SubDVertex * | v | ) | const |
unsigned int ON_SubDEdge::VertexCount | ( | ) | const |
Returns: Number of distinct non-nullptr vertices. If the edge is valid, this will be 2.
unsigned int ON_SubDEdge::VertexId | ( | unsigned | evi | ) | const |
Parameters: evi - [in] 0 or 1 Returns: If evi is 0 or 1 and m_vertex[evi] is not nullptr, then m_vertex[evi]->m_id is returned. Otherwise 0 i returned.
bool ON_SubDEdge::Write | ( | class ON_BinaryArchive & | archive | ) | const |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
static |
ON_SubDEdgeTag ON_SubDEdge::m_edge_tag = ON_SubDEdgeTag::Unset |
When checking the edge tag, it is important to consider what should happen in the ON_SubDEdgeTag::SmoothX case. It is strongly suggested that you use the member functions ON_SubDEdge::IsSmooth() and ON_SubDEdge::IsCrease() instead of comparing m_edge_tag to ON_SubDEdgeTag values.
ON_SubDFacePtr ON_SubDEdge::m_face2[2] = {} |
unsigned short ON_SubDEdge::m_face_count = 0 |
ON_SubDFacePtr* ON_SubDEdge::m_facex = nullptr |
unsigned short ON_SubDEdge::m_facex_capacity = 0 |
const class ON_SubDEdge* ON_SubDEdge::m_next_edge = nullptr |
linked list of edges on this level
const class ON_SubDEdge* ON_SubDEdge::m_prev_edge = nullptr |
m_prev_edge, m_next_edge must be the first data members of ON_SubDEdge
linked list of edges on this level
|
mutable |
If the value of vertex->m_vertex_tag is not ON_SubDVertexTag::Smooth, then that vertex is "tagged".
If the value of m_edge_tag is ON_SubDEdgeTag::Crease, then m_sector_coefficient[] should be {0,0}.
In any case m_sector_coefficient[] values are ignored and the midpoint of the edge is the location of the edge.s subdivision point. The edge's subdivision vertex will be tagged as ON_SubDVertexTag::Crease and both subdivision edges will be tagged as ON_SubDEdgeTag::Crease.
If the value of m_edge_tag is ON_SubDEdgeTag::Smooth and neither end vertex is tagged, then m_sector_coefficient[] should be {0,0}.
In any case m_sector_coefficient[] values are ignored on smooth edges with smooth vertices at both ends. The edge's subdivision vertex will be tagged as ON_SubDVertexTag::Smooth and both subdivision edges will be tagged as ON_SubDEdgeTag::Smooth.
If the value of m_edge_tag is ON_SubDEdgeTag::Smooth and exactly one end vertex is tagged, then the m_sector_coefficient[] value for the tagged end is calculated by ON_SubDSectorType::SectorCoefficient(). tagged_coefficient*tagged_vertex + (1.0 - tagged_coefficient)*untagged_vertex is used when combining the edge ends. The edge's subdivision vertex will be tagged as ON_SubDVertexTag::Smooth and both subdivision edges will be tagged as ON_SubDEdgeTag::Smooth.
If the value of m_edge_tag is ON_SubDEdgeTag::SmoothX, then the edge must have exactly two neighboring faces, both vertices must be tagged and the m_sector_coefficient[] values are calculated by ON_SubDSectorType::SectorCoefficient(). When the edge is subdivided, the midpoint of the edge is the location of the edge.s subdivision point. The edge's subdivision vertex will be tagged as ON_SubDVertexTag::Smooth and both subdivision edges will be tagged as ON_SubDEdgeTag::Smooth.
If the value of m_edge_tag is ON_SubDEdgeTag::Smooth and both end vertices are tagged, that is a severe error condition and the edge is subdivided at its midpoint.
If the value of m_edge_tag is ON_SubDEdgeTag::SmoothX and both end vertices are not tagged, that is a severe error condition and the edge is subdivided at its midpoint.
m_sector_coefficient[tagged_end] = 1/2 + 1/3*cos(theta_k) where "theta_k" is the tagged end's "theta_k", which depends on the vertex tag (dart/crease/corner), the number of faces k in the sector, and the control net crease angle alpha when the tagged end is a corner. Dart: theta_k = 2 * Pi / k Crease: theta_k = Pi / k Corner: theta_k = alpha / k
The name "sector coefficient" is used because the value is a property of the vertex's sector (every smooth edge inside a vertex sector has the same value at the tagged vertex). The sector coefficient does not change which a subdivision is applied.
Wrong values in 3dm files created by OpenNURBS 7.16 and before, fixed in 7.17.
Since 2015-02-20, ON_SubDSectorType::CornerSectorThetaFromCornerAngle(unsigned int sector_face_count, double corner_sector_angle_radians) had been incorrectly computing theta as: corner_sector_theta = corner_sector_angle_radians / (2 * sector_face_count) instead of: corner_sector_theta = corner_sector_angle_radians / sector_face_count.
This is fixed as of Rhino 7.17, but 3dm files created before this version saved the incorrect value.
This changes the coefficients saved in the SubD edge, and in the 3dm files. Rhino recomputes all m_sector_coefficients cached in the SubD edges when adding a SubD to a document, so all values are now correct. This changes SubD subdivision, meshing, limit surface, and limit point editing results, for SubDs that have a smooth edge connected to a corner vertex.
If you are using this value from a SubD in a 3dm file created by Rhino 7.16 or earlier, without adding the SubD to a Rhino document using CRhinoSubDObject::SetSubD(ON_SubDRef subd_ref), you need to recompute all sector coefficients using subd->UpdateAllTagsAndSectorCoefficients(true);
double ON_SubDEdge::m_sharpness = 0.0 |
If m_edge_tag is not ON_SubDEdgeTag::Sharp, then m_sharpness is ignored. If m_edge_tag is ON_SubDEdgeTag::Sharp, then m_sharpness controls how hard/soft the edge appears.
The behavior of a "sharp" edge with m_sharpness = 1 is identical to a crease edge. A "sharp" edge with m_sharpness = 0 is identical to a smooth edge. For this reason, m_sharpness must be > 0 and < 1.
const class ON_SubDVertex* ON_SubDEdge::m_vertex[2] = {} |
m_vertex[0] = vertex at the start of the edge. m_vertex[1] = vertex at the end of the edge.