/// attribute name for distance
const std::string DISTANCE_ATTR = "distance";
-/**\class ConstructionPlugin_Axis
+/**\class ConstructionPlugin_Plane
* \ingroup DataModel
- * \brief Feature for creation of the new axis in PartSet.
+ * \brief Feature for creation of the new planar surface in PartSet.
*/
class ConstructionPlugin_Plane : public ModelAPI_Feature, public GeomAPI_ICustomPrs
{
#include "ModelAPI_Plugin.h"
#include "ModelAPI_Feature.h"
+/**\class ConstructionPlugin_Plugin
+ * \ingroup Plugins
+ * \brief The main class for management the construction features as plugin.
+ */
class CONSTRUCTIONPLUGIN_EXPORT ConstructionPlugin_Plugin : public ModelAPI_Plugin
{
- public:
+public:
/// Creates the feature object of this plugin by the feature string ID
virtual FeaturePtr createFeature(std::string theFeatureID);
- public:
+ /// Default constructor
ConstructionPlugin_Plugin();
};
#include <string>
+/**\class Events_Error
+ * \ingroup EventsLoop
+ * \brief An error message event.
+ *
+ * Is generated by any algorithm or GUI of the application to inform the user about
+ * the problem. In GUI mode all such errors are collected in the message log window.
+ */
class EVENTS_EXPORT Events_Error : public Events_Message
{
char* myDescription; ///< pointer to the description of the error
- public:
+public:
+ /// default destructor
virtual ~Events_Error();
+ /// Identifier of this event (one for all errors)
static Events_ID errorID();
+ /// Specific error string
char* description() const;
+ /// Allows to send an error quickly: it creates and sends the error object automatically
static void send(char* theDescription, const void* theSender = 0);
+ /// Allows to send an error quickly: it creates and sends the error object automatically
static void send(std::string theDescription, const void* theSender = 0);
- protected:
+protected:
+ /// Default constructor. Use "send" message for generation an error.
Events_Error(char* theDescription, const void* theSender = 0);
};
*/
class EVENTS_EXPORT Events_LongOp : public Events_Message
{
- public:
+public:
+ /// Default destructor
virtual ~Events_LongOp();
/// Returns the identifier of this event
static Events_ID eventID();
/// Returns true if the long operation is performed
static bool isPerformed();
- protected:
+protected:
+ /// Default constructor. Use "start" and "end" for generation.
Events_LongOp(void* theSender = 0);
};
EVENTS_EXPORT static Events_ID eventByName(const char* theName);
//! Allows to send an event
+ //! \param theMessage the enevt message to send
//! \param isGroup is true for grouping messages if possible
EVENTS_EXPORT void send(const std::shared_ptr<Events_Message>& theMessage, bool isGroup = true);
#include <map>
+/**\class ExchangePlugin_ImportFeature
+ * \ingroup Plugins
+ * \brief Feature for import shapes from the external files in CAD formats.
+ *
+ * The set of supported formats is defined in the configuration file.
+ */
class ExchangePlugin_ImportFeature : public ModelAPI_Feature
{
public:
static const std::string MY_FILE_PATH_ID("import_file_selector");
return MY_FILE_PATH_ID;
}
-
+ /// default constructor
EXCHANGEPLUGIN_EXPORT ExchangePlugin_ImportFeature();
+ /// default destructor
EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ImportFeature();
/// Returns the unique kind of a feature
}
protected:
+ /// POerforms the import of the file
EXCHANGEPLUGIN_EXPORT bool importFile(const std::string& theFileName);
private:
#include <ModelAPI_Plugin.h>
#include <ModelAPI_Feature.h>
+/**\class ExchangePlugin_Plugin
+ * \ingroup Plugins
+ * \brief The main class for management the import and export operations as plugin.
+ */
class EXCHANGEPLUGIN_EXPORT ExchangePlugin_Plugin : public ModelAPI_Plugin
{
public:
return result;
}
-bool ExchangePlugin_ImportFormatValidator::parsePlugins(const std::list<std::string>& theArguments,
- std::list<std::string>& outPlugins)
-{
- std::list<std::string>::const_iterator it = theArguments.begin();
- bool result = true;
- for (; it != theArguments.end(); ++it) {
- std::string anArg = *it;
- int aSepPos = anArg.find(":");
- if (aSepPos == std::string::npos) {
- result = false;
- continue;
- }
- outPlugins.push_back(anArg.substr(aSepPos + 1));
- }
- return result;
-}
-
bool ExchangePlugin_ImportFormatValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments) const
{
#include "ExchangePlugin.h"
#include <ModelAPI_AttributeValidator.h>
+/**\class ExchangePlugin_ImportFormatValidator
+ * \ingroup Validators
+ * \brief Validator for the imported formats checking
+ *
+ * The configuration file of import/export features contains the information
+ * about which formats are supported and the extension of the associated files.
+ * This validator filters out files that are out of this description.
+ */
class ExchangePlugin_ImportFormatValidator : public ModelAPI_AttributeValidator
{
- /*
+ /**
* Parses input arguments "BREP:BREPImport", "STEP:STEPImport"
* into list of file formats "BREP","STEP"
* and list of corresponding plugins: "BREPImport", "STEPImport"
*/
static bool parseFormats(const std::list<std::string>& theArguments,
std::list<std::string>& outFormats);
- static bool parsePlugins(const std::list<std::string>& theArguments,
- std::list<std::string>& outPlugins);
- public:
+public:
+ /**
+ * Returns true is the file-name attribute correctly corresponds to the set of
+ * allowed formats.
+ */
virtual bool isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments) const;
#include <GeomAPI_Shape.h>
#include <GeomAlgoAPI_Boolean.h>
+/**\class FeaturesPlugin_Boolean
+ * \ingroup Plugins
+ * \brief Feature for applying of Boolean operations on Solids.
+ *
+ * Supports three kinds of Boolean operations: Cut, Fuse and Common.
+ * For all of them requires two Solids: object and tool.
+ */
class FeaturesPlugin_Boolean : public ModelAPI_Feature
{
- public:
+public:
/// Extrusion kind
inline static const std::string& ID()
{
BOOL_COMMON
};
-
/// Returns the kind of a feature
FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
{
#include <ModelAPI_ResultBody.h>
#include <GeomAlgoAPI_Extrusion.h>
#include <GeomAPI_Shape.h>
+
+/**\class FeaturesPlugin_Extrusion
+ * \ingroup Plugins
+ * \brief Feature for creation of extrusion from the planar face.
+ *
+ * Extrusion creates the lateral faces based on edges of the base face and
+ * the top face equal to the base face. Direction of extrusion is taken from the face
+ * plane, but can be corrected by the "reverse" flag.
+ */
class FeaturesPlugin_Extrusion : public ModelAPI_Feature
{
public:
#include <ModelAPI_Feature.h>
#include <GeomAPI_Shape.h>
+/**\class FeaturesPlugin_Group
+ * \ingroup Plugins
+ * \brief Feature for selection of sub-shapes of some shapes.
+ *
+ * All selected sub-shapes must be of equal type (vertex, edge, face, etc) but may
+ * be selected on different objects.
+ */
class FeaturesPlugin_Group : public ModelAPI_Feature
{
public:
static const std::string MY_GROUP_ID("Group");
return MY_GROUP_ID;
}
- /// attribute name of group name
- //inline static const std::string& NAME_ID()
- //{
- // static const std::string MY_GROUP_NAME_ID("group_name");
- // return MY_GROUP_NAME_ID;
- //}
/// attribute name of selected entities list
inline static const std::string& LIST_ID()
{
class ModelAPI_ResultBody;
class GeomAPI_Shape;
+/**\class FeaturesPlugin_Placement
+ * \ingroup Plugins
+ * \brief Feature for applying of placement operation: relative movement of Solid.
+ *
+ * Locates the selected attractable_face of the solid in the middle of the selected
+ * placement_base face. Faces must be planar. Orientation of the placed solid is
+ * depended on the underlied planes of both faces.
+ */
class FeaturesPlugin_Placement : public ModelAPI_Feature
{
public:
#include <ModelAPI_Plugin.h>
#include <ModelAPI_Feature.h>
+/**\class FeaturesPlugin_Plugin
+ * \ingroup Plugins
+ * \brief The main class for management the 3D features as plugin.
+ */
class FEATURESPLUGIN_EXPORT FeaturesPlugin_Plugin : public ModelAPI_Plugin
{
public:
virtual FeaturePtr createFeature(std::string theFeatureID);
public:
+ /// Default constructor
FeaturesPlugin_Plugin();
};
GeomAPI_DataMapOfShapeShape::GeomAPI_DataMapOfShapeShape()
:GeomAPI_Interface((void *)new TopTools_DataMapOfShapeShape){}
-/// Clear
void GeomAPI_DataMapOfShapeShape::clear()
{
implPtr<TopTools_DataMapOfShapeShape>()->Clear();
}
-/// Size
int GeomAPI_DataMapOfShapeShape::size()
{
return implPtr<TopTools_DataMapOfShapeShape>()->Extent();
}
-/// Adds the Key <K> to the Map <me> with the Item. Returns True if the Key was not already in the map
bool GeomAPI_DataMapOfShapeShape::bind (std::shared_ptr<GeomAPI_Shape> theKey, std::shared_ptr<GeomAPI_Shape> theItem)
{
bool flag(false);
return flag;
}
-/// Returns true if theKey is stored in the map.
bool GeomAPI_DataMapOfShapeShape::isBound (std::shared_ptr<GeomAPI_Shape> theKey)
{
bool flag(false);
return flag;
}
-/// Returns the Item stored with the Key in the Map. To be checked before with isBound()
const std::shared_ptr<GeomAPI_Shape> GeomAPI_DataMapOfShapeShape::find(std::shared_ptr<GeomAPI_Shape> theKey)
{
std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
return aShape;
}
-/// Removes the Key from the map. Returns true if the Key was in the Map
bool GeomAPI_DataMapOfShapeShape::unBind(std::shared_ptr<GeomAPI_Shape> theKey)
{
bool flag(false);
* \ingroup DataModel
* \brief DataMap of Shape - Shape defined by TopoDS_Shapes
*/
-
class GEOMAPI_EXPORT GeomAPI_DataMapOfShapeShape : public GeomAPI_Interface
{
public:
/// Size of the map
int size();
- /// Adds the Key <K> to the Map <me> with the Item. Returns True if the Key was not already in the map
+ /// Adds \a theKey to me with \a theItem. Returns True if the Key was not already in the map
bool bind (std::shared_ptr<GeomAPI_Shape> theKey, std::shared_ptr<GeomAPI_Shape> theItem);
/// Returns true if theKey is stored in the map.
class GeomAPI_ICustomPrs
{
public:
+ /// Modifies the given presentation in the custom way.
virtual void customisePresentation(AISObjectPtr thePrs) = 0;
};
/**\class GeomAPI_PlanarEdges
* \ingroup DataModel
- * \brief Interface to the edge object
+ * \brief Interface to the set of edges located in one plane
+ *
+ * Normally this interface corresponds to theedges of the sketch
*/
-
class GeomAPI_PlanarEdges : public GeomAPI_Shape
{
public:
/// Creation of empty (null) shape
GEOMAPI_EXPORT GeomAPI_PlanarEdges();
+ /// Returns whether the shape is alone vertex
GEOMAPI_EXPORT virtual bool isVertex() const;
- /// Returns whether the shape is an edge
+ /// Returns whether the shape is alone edge
GEOMAPI_EXPORT virtual bool isEdge() const;
-
+ /// Appends the edge to the set
GEOMAPI_EXPORT void addEdge(std::shared_ptr<GeomAPI_Shape> theEdge);
+ /// Returns the list of edges in this interface
GEOMAPI_EXPORT std::list<std::shared_ptr<GeomAPI_Shape> > getEdges();
/// Returns True if the wire is defined in a plane
GEOMAPI_EXPORT bool hasPlane() const;
- /// Set/Get origin point
+ /// Sets origin point
GEOMAPI_EXPORT void setOrigin(const std::shared_ptr<GeomAPI_Pnt>& theOrigin);
+ /// Returns the plane origin point
GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Pnt> origin() const;
- /// Set/Get X direction vector
+ /// Sets X direction vector
GEOMAPI_EXPORT void setDirX(const std::shared_ptr<GeomAPI_Dir>& theDirX);
+ /// Returns X direction vector
GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Dir> dirX() const;
- /// Set/Get Y direction vector
+ /// Sets Y direction vector
GEOMAPI_EXPORT void setDirY(const std::shared_ptr<GeomAPI_Dir>& theDirY);
+ /// Returns Y direction vector
GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Dir> dirY() const;
- /// Set/Get Normal direction vector
+ /// Sets Z direction vector
GEOMAPI_EXPORT void setNorm(const std::shared_ptr<GeomAPI_Dir>& theNorm);
+ /// Returns Z direction vector
GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Dir> norm() const;
private:
+ /// Origin point of the plane
std::shared_ptr<GeomAPI_Pnt> myOrigin;
+ /// The X direction inside of the plane
std::shared_ptr<GeomAPI_Dir> myDirX;
+ /// The Y direction inside of the plane
std::shared_ptr<GeomAPI_Dir> myDirY;
+ /// The normal direction to the plane
std::shared_ptr<GeomAPI_Dir> myNorm;
};
/// Creation of empty (null) shape
GeomAPI_Shape();
+ /// Returns true if the underlied shape is null
bool isNull() const;
/// Returns whether the shapes are equal
bool computeSize(double& theXmin, double& theYmin, double& theZmin,
double& theXmax, double& theYmax, double& theZmax) const;
+ /// Returns the shape as BRep stream
std::string getShapeStream() const;
};
class GeomAlgoAPI_Boolean : public GeomAPI_Interface
{
public:
- /* \brief Creates cut boolean operation
+ /**\brief Creates cut boolean operation
* \param[in] theShape the main shape
* \param[in] theTool toole shape for boolean
* \return a solid as result of operation
*/
GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> makeCut(
std::shared_ptr<GeomAPI_Shape> theShape,
- std::shared_ptr<GeomAPI_Shape> theTool);
+ std::shared_ptr<GeomAPI_Shape> theTool);
- /* \brief Creates fuse boolean operation
+ /**\brief Creates fuse boolean operation
* \param[in] theShape the main shape
* \param[in] theTool second shape
* \return a solid as result of operation
std::shared_ptr<GeomAPI_Shape> theShape,
std::shared_ptr<GeomAPI_Shape> theTool);
- /* \brief Creates common boolean operation
+ /**\brief Creates common boolean operation
* \param[in] theObject the main shape
* \param[in] theTool second shape
- * \param[in] theType type of the operation: Fuse, Cut, Common
* \return a solid as result of operation
*/
GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> makeCommon(
return myShape;
}
-/// Returns the list of shapes generated from the shape <theShape>
void GeomAlgoAPI_MakeShape::generated(
const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory)
{
}
}
-/// Returns the list of shapes modified from the shape <theShape>
void GeomAlgoAPI_MakeShape::modified(
const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory)
{
}
}
-/// Returns whether the shape is an edge
bool GeomAlgoAPI_MakeShape::isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
{
bool isDeleted(false);
#include <GeomAPI_Shape.h>
#include <memory>
#include <GeomAlgoAPI.h>
-//#include <BRepBuilderAPI_MakeShape.hxx>
+
/**\class GeomAlgoAPI_MakeShape
* \ingroup DataModel
* \brief Interface to the root class of all topological shapes constructions
*/
class GeomAlgoAPI_MakeShape : public GeomAPI_Interface
{
- public:
- /// Constructor
+public:
+ /// Constructor
GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape();
-
+ /// Constructor by the already stored builder in the interface
GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape(void* theBuilder);
/// Returns a shape built by the shape construction algorithm
GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape> shape() const;
- /// Returns the list of shapes generated from the shape <theShape>
+ /// Returns the list of shapes generated from the shape \a theShape
GEOMALGOAPI_EXPORT virtual void generated(
const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory);
- /// Returns the list of shapes modified from the shape <theShape>
+ /// Returns the list of shapes modified from the shape \a theShape
GEOMALGOAPI_EXPORT virtual void modified(
const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory);
/// Returns whether the shape is an edge
GEOMALGOAPI_EXPORT virtual bool isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
-
+ /// Initializes the algorithm by the builder stored in the interface
GEOMALGOAPI_EXPORT void init(void* theMkShape);
protected:
+ /// The resulting shape
std::shared_ptr<GeomAPI_Shape> myShape;
};
#include <memory>
+/**\class FeaturesPlugin_Plugin
+ * \ingroup Plugins
+ * \brief The main class for management the part set operations as plugin.
+ */
class PARTSETPLUGIN_EXPORT PartSetPlugin_Plugin : public ModelAPI_Plugin,
public Events_Listener
{
/// Returns true is sketch element is under the rigid constraint
SKETCHPLUGIN_EXPORT virtual bool isFixed() {return false;}
+ /// Returns true of the feature is created basing on the external shape of not-this-sketch object
inline bool isExternal() const
{
AttributeSelectionPtr aAttr = data()->selection(EXTERNAL_ID());
#include <ModelAPI_ResultValidator.h>
#include <ModelAPI_Object.h>
+/**\class SketchPlugin_ResultPointValidator
+ * \ingroup Validators
+ * \brief Validator for the points selection
+ *
+ * Allows to select points only.
+ */
class SketchPlugin_ResultPointValidator : public ModelAPI_ResultValidator
{
- public:
+public:
+ /// Returns true if theObject is a point
SKETCHPLUGIN_EXPORT virtual bool isValid(const ObjectPtr theObject) const;
};
+/**\class SketchPlugin_ResultLineValidator
+ * \ingroup Validators
+ * \brief Validator for the linear segments selection
+ *
+ * Allows to select linear segments only.
+ */
class SketchPlugin_ResultLineValidator : public ModelAPI_ResultValidator
{
- public:
+public:
+ /// Returns true if theObject is a line
SKETCHPLUGIN_EXPORT virtual bool isValid(const ObjectPtr theObject) const;
};
+/**\class SketchPlugin_ResultArcValidator
+ * \ingroup Validators
+ * \brief Validator for the circular segments selection
+ *
+ * Allows to select circular segments only.
+ */
class SketchPlugin_ResultArcValidator : public ModelAPI_ResultValidator
{
public:
+ /// Returns true if theObject is an arc
SKETCHPLUGIN_EXPORT virtual bool isValid(const ObjectPtr theObject) const;
};
SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
protected:
- /// Creates a plane and append it to the list
- /// \param theX the X normal value
- /// \param theY the Y normal value
- /// \param theZ the Z normal value
- /// \param theShapes the list of result shapes
- //void addPlane(double theX, double theY, double theZ,
- // std::list<std::shared_ptr<GeomAPI_Shape> >& theShapes) const;
-
/// Checks whether the plane is set in the sketch.
/// \returns the boolean state
bool isPlaneSet();
#include "SketchPlugin.h"
#include <ModelAPI_RefAttrValidator.h>
+/**\class SketchPlugin_DistanceAttrValidator
+ * \ingroup Validators
+ * \brief Validator for the distance input.
+ *
+ * It just checks that distance is greater than zero.
+ */
class SketchPlugin_DistanceAttrValidator : public ModelAPI_RefAttrValidator
{
public:
const AttributePtr& theAttribute) const { return true; };
};
-/**
+/**\class SketchPlugin_DifferentObjectsValidator
+ * \ingroup Validators
+ *
* Check that there is no same object was already selected in the feature.
* For an example: to avoid perpendicularity on line and the same line.
*/
*/
class SketchSolver_Constraint
{
- public:
+public:
+ /// Default constructor
SketchSolver_Constraint();
+ /// Creates constraint to manage the given constraint from plugin
SketchSolver_Constraint(std::shared_ptr<SketchPlugin_Constraint> theConstraint);
/** \brief Compute constraint type according to SolveSpace identifiers
/// Tolerance for value of parameters
const double tolerance = 1.e-10;
-/*
+/**
* Collects all sketch solver error' codes
* as inline static functions
- * TODO: Move this class into a separate file
*/
+ // TODO: Move this class into a separate file
class SketchSolver_Error
{
public:
* \return \c true if the constraint added or updated successfully
*/
bool changeConstraint(std::shared_ptr<SketchPlugin_Constraint> theConstraint);
+ /** \brief Adds or updates a rigid constraint in the group
+ * \param[in] theConstraint constraint to be changed
+ * \return \c true if the constraint added or updated successfully
+ */
bool changeRigidConstraint(std::shared_ptr<SketchPlugin_Constraint> theConstraint);
/** \brief Verifies the feature attributes are used in this group
*/
bool isBaseWorkplane(std::shared_ptr<ModelAPI_CompositeFeature> theWorkplane) const;
+ /// Returns the current workplane
std::shared_ptr<ModelAPI_CompositeFeature> getWorkplane() const
{
return mySketch;
// Unknown entity
#define SLVS_E_UNKNOWN 0
+/**
+ * The main class that performs the high-level operations for connection to the SolveSpace.
+ */
class SketchSolver_Solver
{
public: