SHAPER  9.12.0
SketchAPI_Line Class Reference

Interface for Line feature. More...

Inheritance diagram for SketchAPI_Line:
Inheritance graph

Public Member Functions

 SketchAPI_Line (const std::shared_ptr< ModelAPI_Feature > &theFeature)
 Constructor without values. More...
 
 SketchAPI_Line (const std::shared_ptr< ModelAPI_Feature > &theFeature, double theX1, double theY1, double theX2, double theY2)
 Constructor with values. More...
 
 SketchAPI_Line (const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::shared_ptr< GeomAPI_Pnt2d > &theStartPoint, const std::shared_ptr< GeomAPI_Pnt2d > &theEndPoint)
 Constructor with values. More...
 
 SketchAPI_Line (const std::shared_ptr< ModelAPI_Feature > &theFeature, const ModelHighAPI_Selection &theExternal)
 Constructor with values. More...
 
 SketchAPI_Line (const std::shared_ptr< ModelAPI_Feature > &theFeature, const std::wstring &theExternalName)
 Constructor with values. More...
 
virtual ~SketchAPI_Line ()
 Destructor. More...
 
virtual std::string getID ()
 
virtual std::shared_ptr< GeomDataAPI_Point2DstartPoint () const
 Start point. More...
 
virtual std::shared_ptr< GeomDataAPI_Point2DendPoint () const
 End point. More...
 
virtual std::shared_ptr< ModelAPI_AttributeSelectionexternal () const
 External. More...
 
void setByCoordinates (double theX1, double theY1, double theX2, double theY2)
 Set by coordinates. More...
 
void setByPoints (const std::shared_ptr< GeomAPI_Pnt2d > &theStartPoint, const std::shared_ptr< GeomAPI_Pnt2d > &theEndPoint)
 Set by points. More...
 
void setByExternal (const ModelHighAPI_Selection &theExternal)
 Set by external. More...
 
void setByExternalName (const std::wstring &theExternalName)
 Set by external name. More...
 
void setStartPoint (double theX, double theY)
 Set start point. More...
 
void setStartPoint (const std::shared_ptr< GeomAPI_Pnt2d > &thePoint)
 Set start point. More...
 
void setEndPoint (double theX, double theY)
 Set end point. More...
 
void setEndPoint (const std::shared_ptr< GeomAPI_Pnt2d > &thePoint)
 Set end point. More...
 
virtual void dump (ModelHighAPI_Dumper &theDumper) const
 Dump wrapped feature. More...
 
std::shared_ptr< ModelAPI_AttributeBooleanauxiliary () const
 Auxiliary. More...
 
void setAuxiliary (bool theAuxiliary)
 Set auxiliary. More...
 
std::shared_ptr< ModelAPI_Featurefeature () const
 Return ModelAPI_Feature. More...
 
std::shared_ptr< ModelHighAPI_InterfacesubFeature (const int theIndex) const
 If feature is composite return intefrace for sub-feature by zero-based index, or empty pointer if feature not composite or does not have sub-feature with such index. More...
 
const std::string & getKind () const
 Shortcut for feature()->getKind() More...
 
void execute (bool isForce=false)
 Shortcut for feature()->execute() More...
 
void setName (const std::wstring &theName)
 Shortcut for feature()->data()->setName() More...
 
std::wstring name () const
 Shortcut for feature()->data()->name() More...
 
virtual ModelHighAPI_Selection result () const
 Return firts object of the feature. More...
 
virtual std::list< ModelHighAPI_Selectionresults () const
 Return all objects of the feature. More...
 
virtual std::shared_ptr< ModelAPI_ResultdefaultResult () const
 Return default result. Default implementation feature()->lastResult() More...
 
void throwException (const std::string &theDescription)
 Throw exception to event loop. More...
 
const std::string & attributeGetter (const std::string &theAttrName)
 Return name of getter for specified attribute. More...
 

Static Public Member Functions

static std::string ID ()
 
static std::list< std::shared_ptr< SketchAPI_SketchEntity > > wrap (const std::list< std::shared_ptr< ModelAPI_Feature > > &theFeatures)
 Convert list of features to list of appropriate wrappers. More...
 

Protected Member Functions

bool initialize ()
 
bool isCopy () const
 Check the entity is a copy of another feature. More...
 

Protected Attributes

std::shared_ptr< GeomDataAPI_Point2DmystartPoint
 
std::shared_ptr< GeomDataAPI_Point2DmyendPoint
 
std::shared_ptr< ModelAPI_AttributeSelectionmyexternal
 
std::shared_ptr< ModelAPI_AttributeBooleanmyAuxiliary
 
std::shared_ptr< ModelAPI_FeaturemyFeature
 feature of this interface More...
 
std::map< std::string, std::string > myAttrGetter
 names of attributes and their getters More...
 

Detailed Description

Interface for Line feature.

Constructor & Destructor Documentation

◆ SketchAPI_Line() [1/5]

SketchAPI_Line::SketchAPI_Line ( const std::shared_ptr< ModelAPI_Feature > &  theFeature)
explicit

Constructor without values.

◆ SketchAPI_Line() [2/5]

SketchAPI_Line::SketchAPI_Line ( const std::shared_ptr< ModelAPI_Feature > &  theFeature,
double  theX1,
double  theY1,
double  theX2,
double  theY2 
)

Constructor with values.

◆ SketchAPI_Line() [3/5]

SketchAPI_Line::SketchAPI_Line ( const std::shared_ptr< ModelAPI_Feature > &  theFeature,
const std::shared_ptr< GeomAPI_Pnt2d > &  theStartPoint,
const std::shared_ptr< GeomAPI_Pnt2d > &  theEndPoint 
)

Constructor with values.

◆ SketchAPI_Line() [4/5]

SketchAPI_Line::SketchAPI_Line ( const std::shared_ptr< ModelAPI_Feature > &  theFeature,
const ModelHighAPI_Selection theExternal 
)

Constructor with values.

◆ SketchAPI_Line() [5/5]

SketchAPI_Line::SketchAPI_Line ( const std::shared_ptr< ModelAPI_Feature > &  theFeature,
const std::wstring &  theExternalName 
)

Constructor with values.

◆ ~SketchAPI_Line()

SketchAPI_Line::~SketchAPI_Line ( )
virtual

Destructor.

Member Function Documentation

◆ startPoint()

virtual std::shared_ptr< GeomDataAPI_Point2D > SketchAPI_Line::startPoint ( ) const
inlinevirtual

Start point.

◆ endPoint()

virtual std::shared_ptr< GeomDataAPI_Point2D > SketchAPI_Line::endPoint ( ) const
inlinevirtual

End point.

◆ external()

virtual std::shared_ptr< ModelAPI_AttributeSelection > SketchAPI_Line::external ( ) const
inlinevirtual

External.

◆ setByCoordinates()

void SketchAPI_Line::setByCoordinates ( double  theX1,
double  theY1,
double  theX2,
double  theY2 
)

Set by coordinates.

◆ setByPoints()

void SketchAPI_Line::setByPoints ( const std::shared_ptr< GeomAPI_Pnt2d > &  theStartPoint,
const std::shared_ptr< GeomAPI_Pnt2d > &  theEndPoint 
)

Set by points.

◆ setByExternal()

void SketchAPI_Line::setByExternal ( const ModelHighAPI_Selection theExternal)

Set by external.

◆ setByExternalName()

void SketchAPI_Line::setByExternalName ( const std::wstring &  theExternalName)

Set by external name.

◆ setStartPoint() [1/2]

void SketchAPI_Line::setStartPoint ( double  theX,
double  theY 
)

Set start point.

◆ setStartPoint() [2/2]

void SketchAPI_Line::setStartPoint ( const std::shared_ptr< GeomAPI_Pnt2d > &  thePoint)

Set start point.

◆ setEndPoint() [1/2]

void SketchAPI_Line::setEndPoint ( double  theX,
double  theY 
)

Set end point.

◆ setEndPoint() [2/2]

void SketchAPI_Line::setEndPoint ( const std::shared_ptr< GeomAPI_Pnt2d > &  thePoint)

Set end point.

◆ dump()

void SketchAPI_Line::dump ( ModelHighAPI_Dumper theDumper) const
virtual

Dump wrapped feature.

Reimplemented from SketchAPI_SketchEntity.

◆ auxiliary()

std::shared_ptr< ModelAPI_AttributeBoolean > SketchAPI_SketchEntity::auxiliary ( ) const
inherited

Auxiliary.

◆ setAuxiliary()

void SketchAPI_SketchEntity::setAuxiliary ( bool  theAuxiliary)
inherited

Set auxiliary.

◆ wrap()

std::list< std::shared_ptr< SketchAPI_SketchEntity > > SketchAPI_SketchEntity::wrap ( const std::list< std::shared_ptr< ModelAPI_Feature > > &  theFeatures)
staticinherited

Convert list of features to list of appropriate wrappers.

◆ isCopy()

bool SketchAPI_SketchEntity::isCopy ( ) const
protectedinherited

Check the entity is a copy of another feature.

◆ feature()

std::shared_ptr< ModelAPI_Feature > ModelHighAPI_Interface::feature ( ) const
inherited

◆ subFeature()

std::shared_ptr< ModelHighAPI_Interface > ModelHighAPI_Interface::subFeature ( const int  theIndex) const
inherited

If feature is composite return intefrace for sub-feature by zero-based index, or empty pointer if feature not composite or does not have sub-feature with such index.

◆ getKind()

const std::string & ModelHighAPI_Interface::getKind ( ) const
inherited

Shortcut for feature()->getKind()

◆ execute()

void ModelHighAPI_Interface::execute ( bool  isForce = false)
inherited

Shortcut for feature()->execute()

Parameters
isForcestart execution of feature instead of sending events

◆ setName()

void ModelHighAPI_Interface::setName ( const std::wstring &  theName)
inherited

Shortcut for feature()->data()->setName()

◆ name()

std::wstring ModelHighAPI_Interface::name ( ) const
inherited

Shortcut for feature()->data()->name()

◆ result()

ModelHighAPI_Selection ModelHighAPI_Interface::result ( ) const
virtualinherited

Return firts object of the feature.

◆ results()

std::list< ModelHighAPI_Selection > ModelHighAPI_Interface::results ( ) const
virtualinherited

Return all objects of the feature.

◆ defaultResult()

std::shared_ptr< ModelAPI_Result > ModelHighAPI_Interface::defaultResult ( ) const
virtualinherited

Return default result. Default implementation feature()->lastResult()

◆ throwException()

void ModelHighAPI_Interface::throwException ( const std::string &  theDescription)
inherited

Throw exception to event loop.

◆ attributeGetter()

const std::string & ModelHighAPI_Interface::attributeGetter ( const std::string &  theAttrName)
inherited

Return name of getter for specified attribute.

Field Documentation

◆ myFeature

std::shared_ptr<ModelAPI_Feature> ModelHighAPI_Interface::myFeature
protectedinherited

feature of this interface

◆ myAttrGetter

std::map<std::string, std::string> ModelHighAPI_Interface::myAttrGetter
protectedinherited

names of attributes and their getters