C3D Toolkit
Kernel - 117982, Vision - 2.9.2.2
|
Edge. More...
#include <topology.h>
Public Member Functions | |
MbEdge (const MbCurve3D &initCurve, bool sense, const MbVertex &beg, const MbVertex &end) | |
Constructor by curve, its orientation and vertices. | |
MbEdge (const MbCurve3D &initCurve, bool sense, const MbVertex *beg, const MbVertex *end) | |
Constructor by curve, its orientation and vertices. More... | |
MbEdge (const MbCurve3D &initCurve, bool sense) | |
Constructor by curve and its orientation. More... | |
MbEdge (const MbEdge &other, const MbCurve3D &newCurve) | |
Copy constructor using other curve. | |
virtual | ~MbEdge () |
Destructor. | |
MbeTopologyType | IsA () const override |
A type of element. | |
virtual MbEdge * | DataDuplicate (MbRegDuplicate *=nullptr) const |
Create new edge by copying all data of the initial edge. | |
void | Transform (const MbMatrix3D &, MbRegTransform *=nullptr) override |
Transform according to the matrix. More... | |
void | Move (const MbVector3D &, MbRegTransform *=nullptr) override |
Move along a vector. More... | |
void | Rotate (const MbAxis3D &, double angle, MbRegTransform *=nullptr) override |
Rotate around an axis. More... | |
double | DistanceToPoint (const MbCartPoint3D &) const override |
Calculate the distance to a point. | |
void | AddYourGabaritTo (MbCube &) const override |
Add your own bounding box into the sent bounding box. | |
void | CalculateLocalGabarit (const MbMatrix3D &into, MbCube &cube) const override |
Calculate bounding box in the local coordinate system which is given by the matrix of transformation to this system. | |
virtual void | SetOwnChangedThrough (MbeChangedType) |
Set the flag that the object has been changed. | |
virtual void | Reverse () |
Change direction of edge without changing a curve. | |
bool | IsSame (const MbTopologyItem &other, double accuracy) const override |
Determine whether objects are equal. | |
void | CalculateMesh (const MbStepData &stepData, const MbFormNote ¬e, MbMesh &mesh) const override |
Construct a polygonal copy of an object mesh). | |
virtual bool | ChangeCurve (MbCurve3D &crv) |
Replacement of a curve by the curve 'crv'. | |
const MbCurve3D & | GetCurve () const |
Get a curve where an edge passes. | |
MbCurve3D & | SetCurve () |
Get a curve where an edge passes. | |
bool | IsSameSense () const |
Get the direction relative to the curve. | |
void | SetSameSense (bool s) |
Set the direction relative to the curve. | |
const MbVertex * | GetBegVertexPointer () const |
Get the start vertex. | |
const MbVertex * | GetEndVertexPointer () const |
Get the end vertex. | |
MbVertex * | SetBegVertexPointer () |
Get the start vertex. | |
MbVertex * | SetEndVertexPointer () |
Get the end vertex. | |
const MbVertex & | GetBegVertex () const |
Get the start vertex. | |
const MbVertex & | GetEndVertex () const |
Get the end vertex. | |
const MbVertex & | GetVertex (size_t i) const |
Get vertex by number (0 - start vertex, 1 - end vertex). | |
MbVertex & | SetBegVertex () |
Get the start vertex. | |
MbVertex & | SetEndVertex () |
Get the end vertex. | |
MbVertex & | SetVertex (size_t i) |
Get vertex by number (0 - start vertex, 1 - end vertex). | |
void | SetBegVertex (const MbVertex &ver) |
Set the start vertex. | |
void | SetEndVertex (const MbVertex &ver) |
Set the end vertex. | |
const MbVertex & | GetTMinVertex () const |
Get a vertex corresponding to the start point of a curve. | |
const MbVertex & | GetTMaxVertex () const |
Get a vertex corresponding to the end point of a curve. | |
MbVertex & | SetTMinVertex () |
Get a vertex corresponding to the start point of a curve. | |
MbVertex & | SetTMaxVertex () |
Get a vertex corresponding to the end point of a curve. | |
void | SetTMinVertex (const MbVertex &ver) |
Set a vertex corresponding to the start point of a curve. | |
void | SetTMaxVertex (const MbVertex &ver) |
Set a vertex corresponding to the end point of a curve. | |
double | GetTBegVertex () const |
Get curve parameter corresponding to the start vertex. | |
double | GetTEndVertex () const |
Get curve parameter corresponding to the end vertex. | |
bool | IsStraight (bool ignoreParams=false) const |
Is an edge rectilinear? | |
void | GetBegVertexPoint (MbCartPoint3D &cp) const |
Get Cartesian point of start vertex. | |
void | GetEndVertexPoint (MbCartPoint3D &cp) const |
Get Cartesian point of end vertex. | |
bool | IsColinear (const MbPlacement3D &p, double epsilon=Math::angleRegion) const |
Is an edge parallel to the placement? | |
bool | IsClosed () const |
Is an edge cyclic closed? | |
void | SetLabelThrough (MbeLabelState l, void *key=nullptr) const |
Set a label for self and vertices. | |
void | SetLabelThrough (MbeLabelState l, void *key, bool setLock) const |
Set a label for self and vertices. | |
void | RemovePrivateLabelThrough (void *key) const |
Remove private label for self and vertices. | |
bool | IsVertexOn (const MbVertex *vertex) const |
Check that vertices belong to an edge. | |
const MbVertex * | IsConnectedWith (const MbEdge &edge) const |
A search of common vertex between edges. | |
void | GetVerticesArray (RPArray< MbVertex > &) |
Add vertices in a set of vertices (if they do not exist). | |
void | GetVerticesArray (RPArray< const MbVertex > &) const |
Add vertices in a set of vertices (if they do not exist). | |
double | GetCurveParam (double w) const |
Get parameter on a curve by the parameter on an edge (0 <= w <= 1). | |
double | GetEdgeParam (double t) const |
Get parameter from 0 (start) to 1 (end) for an edge by the parameter of a curve. | |
void | Point (double t, MbCartPoint3D &) const |
Calculate point on the edge (0 <= t <= 1). | |
void | GetBegPoint (MbCartPoint3D &p) const |
Get point at start vertex. | |
void | GetEndPoint (MbCartPoint3D &p) const |
Get point at end vertex. | |
void | Tangent (double t, MbVector3D &) const |
Get tangent vector to the edge (0 <= t <= 1). | |
void | GetBegTangent (MbVector3D &v) const |
Get tangent vector at start vertex. | |
void | GetEndTangent (MbVector3D &v) const |
Get the tangent vector at the end vertex. | |
void | GetMiddleDerive (MbVector3D &) const |
Calculate derivative in the middle of an edge. | |
double | GetMetricLength () const |
Get the metric length of an edge. | |
double | GetLengthEvaluation () const |
Get the estimate of metric length of an edge. | |
double | DistanceToEdge (const MbEdge &edge, MbCartPoint3D &p0, MbCartPoint3D &p1) const |
Calculate the nearest distance to an edge. | |
double | DistanceToFace (const MbFace &face, MbCartPoint3D &p0, MbCartPoint3D &p1) const |
Calculate the nearest distance to a face. | |
double | DistanceToSurface (const MbSurface &surf, MbCartPoint3D &p0, MbCartPoint3D &p1) const |
Calculate the nearest distance to a surface. | |
double | PointProjection (const MbCartPoint3D &) const |
Calculate the point projection on the edge. | |
bool | PointProjection (const MbCartPoint3D &p0, MbCartPoint3D &pOnEdge, double &distance) const |
Calculate the point projection on extension of a straight edge. | |
bool | AngleWithEdge (const MbEdge &, double &angle) const |
Calculate an angle between straight edges. | |
MbCurve * | GetProjection (const MbPlacement3D &, VERSION version) const |
Create projection of an edge to the plane. | |
void | GetProperties (MbProperties &) |
Get properties of the object. | |
void | SetProperties (const MbProperties &) |
Set properties of the object. | |
Public Member Functions inherited from MbTopologyItem | |
virtual | ~MbTopologyItem () |
Destructor. | |
MbeImplicationType | ImplicationType () const override |
A type of element. More... | |
const MbName & | GetName () const |
Get name of object. | |
MbName & | SetName () |
Get name of object for modification. | |
SimpleName | GetMainName () const |
Get main name. | |
void | SetMainName (SimpleName n) |
Set main name. | |
SimpleName | GetFirstName () const |
Get first name. | |
SimpleName | GetNameHash () const |
Get hash of name. | |
void | SetName (const MbName &n) |
Set name. | |
bool | GetOwnChanged () const |
Get flag which indicates that an object has (not) been changed. | |
bool | GetOwnChanged (MbeChangedType n) const |
Get flag which indicates that an object has (not) been changed. | |
void | SetOwnChanged (MbeChangedType) |
Set flag which indicates that an object has (not) been changed. | |
void | CopyOwnChanged (const MbTopologyItem &ti) |
Copy flag which indicates that an object has (not) been changed. | |
uint16 | GetOwnChangedFlag () const |
Get flag which indicates that an object has (not) been changed. | |
template<class Uint > | |
void | SetOwnChangedFlag (Uint n) |
Set flag which indicates that an object has (not) been changed. | |
bool | IsOwnRenamedOnly () const |
Get flag which indicates that an object has been renamed only. | |
bool | IsOwnTransformedOnly () const |
Get flag which indicates that an object has been transformed only. | |
bool | IsOwnReorientedOnly () const |
Get flag which indicates that an object has been reoriented only. | |
bool | IsOwnChangedWeakly () const |
Get a flag indicating that only “weak” changes were applied: creation, renaming, transformation, reorientation. More... | |
MbeLabelState | GetLabel (void *key=nullptr) const |
Get label. | |
void | SetOwnLabel (MbeLabelState l, void *key=nullptr) const |
Set a label of the loop. | |
void | SetOwnLabel (MbeLabelState l, void *key, bool setLock) const |
Set a label of the loop. | |
bool | ToDelete () const |
Is this object intended for deletion? This is defined by labels. | |
void | RemovePrivateLabel (void *key=nullptr) const |
Remove private label. | |
void | Assign (const MbTopologyItem &) |
Copying of the object data. | |
void | RemoveParentNamesAttribute () |
Delete an attribute of name type with parent names. | |
Public Member Functions inherited from MbTopItem | |
MbeRefType | RefType () const override |
Registration type (for copying, duplication). | |
void | PrepareWrite () const |
Prepare an object for writing. | |
bool | IsAVertex () const |
Is it a vertex? | |
bool | IsAWireEdge () const |
Is it an edge of wireframe? | |
bool | IsAnEdge () const |
Is it an edge? | |
bool | IsAFace () const |
Is it a face? | |
bool | IsAShell () const |
Is it a shell? | |
bool | IsAProxy () const |
Is it a proxy? | |
Public Member Functions inherited from MbRefItem | |
refcount_t | GetUseCount () const |
Get count of references (get count of owners of an object). | |
refcount_t | AddRef () const |
Increase count of references by one. | |
refcount_t | DecRef () const |
Decrease count of references by one. | |
refcount_t | Release () const |
Decrease count of references by one and if count of references became zero, then remove itself. | |
Public Member Functions inherited from TapeBase | |
TapeBase (RegistrableRec regs=noRegistrable) | |
Constructor. | |
TapeBase (const TapeBase &) | |
Copy-constructor. | |
virtual | ~TapeBase () |
Destructor. | |
RegistrableRec | GetRegistrable () const |
Whether the stream class is registrable. | |
void | SetRegistrable (RegistrableRec regs=registrable) const |
Set the state of registration of the stream class. | |
virtual const char * | GetPureName (const VersionContainer &) const |
Get the class name. | |
virtual bool | IsFamilyRegistrable () const |
Whether the object belongs to a registrable family. | |
Public Member Functions inherited from MbAttributeContainer | |
MbAttributeContainer () | |
Constructor without parameters. | |
MbAttributeContainer (MbAttribute &) | |
Constructor by attribute. | |
virtual | ~MbAttributeContainer () |
Destructor. | |
void | AttributesRead (reader &) |
Read attributes from stream. | |
void | AttributesWrite (writer &) const |
Writing attributes to stream. | |
void | GetProperties (MbProperties &) |
Get properties of attributes. | |
void | SetProperties (const MbProperties &) |
Set properties of attributes. | |
void | SetDensity (double) |
Set density of an object. | |
double | GetDensity () const |
Get density of an object. | |
void | SetVisual (float a, float d, float sp, float sh, float t, float e, uint rgb=0) |
Set visual properties of the object. | |
void | SetVisual (const MbRGBA &ambient, const MbRGBA &diffuse, const MbRGBA &specular, const MbRGBA &emission, uint8 shininess, uint8 opacity, uint8 chrom) |
Set visual properties of the object. | |
bool | GetVisual (float &a, float &d, float &sp, float &sh, float &t, float &e, uint rgb=0) const |
Get visual properties of the object. More... | |
bool | IsColored () const |
void | SetColor (uint32) |
Change color of the object. | |
void | SetColor (int R, int G, int B) |
Change color of the object (0-255). | |
uint32 | GetColor () const |
Get color of an object. | |
void | SetWidth (int) |
Set thickness of lines for object's representation. | |
int | GetWidth () const |
Get thickness of lines for object's representation. | |
void | SetStyle (int) |
Set style of lines for object's representation. | |
int | GetStyle () const |
Get style of lines for object's representation. | |
void | SetSelected (bool s=true) |
To allocate or not to allocate an object. | |
bool | IsSelected () const |
Is the object selected. | |
bool | ReverseSelected () |
Invert object selection. | |
void | SetChanged (bool c=true) |
Set: the object is changed or isn't changed. | |
bool | IsChanged () const |
Is the object changed? | |
void | SetVisible (bool) |
Set visibility. | |
bool | IsVisible () const |
Is the object visible? | |
bool | IsInvisible () const |
Is the object invisible? | |
void | AttributesAssign (const MbAttributeContainer &) |
Duplicate attributes of a given object, release existing attributes. | |
size_t | AttributesCount () const |
Get the number of objects. | |
bool | RemoveAttributes (bool onDeleteOwner=false) |
Delete all attributes from container. | |
MbAttribute * | AddAttribute (MbAttribute *attr, bool checkSame=true) |
Add attribute in container. More... | |
MbAttribute * | AddAttribute (const MbAttribute &attr, bool checkSame=true) |
Add attribute in container (adds a copy of the attribute if it can be added). More... | |
void | GetAttributes (c3d::AttrVector &attrs, MbeAttributeType aFamily, MbeAttributeType subType) const |
Get attributes of a given type or family. More... | |
void | GetAttributes (c3d::AttrVector &attrs, MbeAttributeType aType) const |
Get attributes of a given type. More... | |
template<class AttrVector > | |
void | GetAttributes (AttrVector &attrs) const |
Get attributes. More... | |
void | GetCommonAttributes (c3d::AttrVector &, const c3d::string_t &samplePrompt, MbeAttributeType subType=at_Undefined, bool firstFound=false) const |
Get attributes using sample of description string. | |
void | GetStringAttributes (c3d::AttrVector &, const c3d::string_t &sampleContent) const |
Get string attributes using sample of contents of the string. | |
bool | RemoveAttribute (const MbAttribute *, bool checkAccuracySame=false, double accuracy=LENGTH_EPSILON) |
Get an attribute of a given type, the first one is returned if there are many. More... | |
bool | RemoveAttributes (MbeAttributeType type, MbeAttributeType subType) |
Delete attributes of a given type. | |
const MbAttribute * | GetSimpleAttribute (MbeAttributeType) const |
Get a simple attribute of a given subtype. | |
MbAttribute * | SetSimpleAttribute (MbeAttributeType) |
Get a simple attribute of a given subtype. | |
MbAttribute * | SetSimpleAttribute (MbAttribute *simpAttr) |
Set a simple attribute of a given subtype. | |
MbAttribute * | SetSimpleAttribute (const MbAttribute &simpAttr) |
Set a simple attribute of a given subtype (always copies the attribute). | |
void | RemoveSimpleAttribute (MbeAttributeType) |
Delete simple attributes (one or more) of a given subtype. | |
MbAttribute * | DetachSimpleAttribute (MbeAttributeType) |
Detach a simple attribute of a given subtype. | |
void | GetUserAttributes (std::vector< MbUserAttribute * > &attrs, const MbUserAttribType &type) const |
Get a user attribute of a given subtype. | |
void | RemoveUserAttributes (const MbUserAttribType &type) |
Delete user attributes (one or more) of a given subtype. | |
void | DetachUserAttributes (std::vector< MbUserAttribute * > &attrs, const MbUserAttribType &type) |
Detach a user attribute of a given subtype. | |
void | AttributesChange () |
Perform actions when changing the attributes. | |
void | AttributesConvert (MbAttributeContainer &other) const |
Perform actions when converting the attributes. | |
void | AttributesTransform (const MbMatrix3D &, MbRegTransform *=nullptr) |
Perform actions when transforming the attributes. | |
void | AttributesMove (const MbVector3D &, MbRegTransform *=nullptr) |
Perform actions when moving the attributes. | |
void | AttributesRotate (const MbAxis3D &, double angle, MbRegTransform *=nullptr) |
Perform actions when rotating the attributes. | |
void | AttributesCopy (MbAttributeContainer &other, MbRegDuplicate *=nullptr) const |
Perform actions when copying the attributes. | |
void | AttributesMerge (MbAttributeContainer &other) |
Perform actions when merging the attributes. | |
void | AttributesReplace (MbAttributeContainer &other) |
Perform actions when replacing the attributes. | |
void | AttributesSplit (const std::vector< MbAttributeContainer * > &others) |
Perform actions when splitting the attributes. | |
void | AttributesDelete () |
Perform actions when deleting the attributes. | |
Protected Member Functions | |
MbEdge (const MbEdge &init, MbRegDuplicate *iReg) | |
Copy constructor. | |
Protected Member Functions inherited from MbTopologyItem | |
MbTopologyItem () | |
Constructor without parameters. | |
MbTopologyItem (const MbTopologyItem &, MbRegDuplicate *) | |
Constructor of duplicating. | |
Protected Member Functions inherited from MbTopItem | |
MbTopItem () | |
Constructor. | |
Protected Member Functions inherited from MbRefItem | |
MbRefItem () | |
Constructor without parameters. | |
Protected Member Functions inherited from MbAttributeContainer | |
MbAttributeContainer (const MbAttributeContainer &, MbRegDuplicate *) | |
Copy-constructor with the registrator. | |
Protected Attributes | |
MbCurve3D * | curve |
A curve, an edge passes by (it is always not nullptr). | |
bool | sameSense |
An attribute of coincidence between direction of curve and direction of edge. | |
MbVertex * | begVertex |
Start vertex (always not nullptr). | |
MbVertex * | endVertex |
End vertex (always not nullptr). | |
Protected Attributes inherited from MbTopologyItem | |
MbLabel | label |
Temporary label for performing of operations. | |
Additional Inherited Members | |
Static Public Member Functions inherited from MbAttributeContainer | |
static MbUserAttribute * | ReduceUserAttrib (const MbExternalAttribute &) |
Convert user attribute to "system" one. | |
static MbExternalAttribute * | AdvanceUserAttrib (const MbUserAttribute &) |
Convert "system" attribute to user one. | |
Edge.
An edge is a curve with direction.
Direction of a curve MbCurve3D is rigidly connected with direction of increasing of its parameter. In contrast to a curve an edge may be directed either in the direction of increase of parameter or in the direction of decrease of parameter. An edge always starts and ends at some vertex MbVertex.
MbEdge::MbEdge | ( | const MbCurve3D & | initCurve, |
bool | sense, | ||
const MbVertex * | beg, | ||
const MbVertex * | end | ||
) |
Constructor by curve, its orientation and vertices.
Constructor of edge by curve, its orientation and vertices. There is performed a check of existence and correctness of location of edge vertices points.
MbEdge::MbEdge | ( | const MbCurve3D & | initCurve, |
bool | sense | ||
) |
Constructor by curve and its orientation.
Constructor of edge by curve and its orientation. Vertices are constructed by boundary points of curve.
|
overridevirtual |
Transform according to the matrix.
Transformation of an object according to the matrix. This object can be contained as pointer in several other objects for transformations. Registrar is used to prevent multiple transformation of this object. When transforming the object with registrator, the existence of the object inside the registrator is verified. If such object is absent, it is stored to the registrator and transformed, otherwise, a transformation of the object is not performed.
[in] | matr | - A transformation matrix. |
[in] | iReg | - Registrator. |
Implements MbTopologyItem.
|
overridevirtual |
Move along a vector.
Move an object along a vector. When transforming the object with registrator, the existence of the object inside the registrator is verified. If such object is absent, it is stored to the registrator and transformed, otherwise, a transformation of the object is not performed.
[in] | to | - Translation vector. |
[in] | iReg | - Registrator. |
Implements MbTopologyItem.
|
overridevirtual |
Rotate around an axis.
Rotate an object at a given angle around an axis. When transforming the object with registrator, the existence of the object inside the registrator is verified. If such object is absent, it is stored to the registrator and transformed, otherwise, a transformation of the object is not performed.
[in] | axis | - Rotation axis. |
[in] | angle | - The rotation angle. |
[in] | iReg | - Registrator. |
Implements MbTopologyItem.