20 #ifndef GeomAlgoAPI_ShapeInfo_H_
21 #define GeomAlgoAPI_ShapeInfo_H_
23 #include "GeomAlgoAPI.h"
25 #include <GeomAPI_Shape.h>
26 #include <GeomAPI_Vertex.h>
27 #include <GeomAPI_Pnt.h>
28 #include <GeomAPI_Edge.h>
29 #include <GeomAPI_Face.h>
48 const int& type()
const {
return myType; }
49 const std::string& string()
const {
return myStr; }
50 const double& real()
const {
return myDouble; }
51 const bool& boolean()
const {
return myBool; }
68 std::shared_ptr<GeomAPI_Shape> myShape;
69 std::string myShapeType;
74 : myShape(theShape) {}
82 GEOMALGOAPI_EXPORT
virtual std::string translate(
const char* theSource) {
return theSource; }
89 GEOMALGOAPI_EXPORT
const std::string&
shapeType() {
return myShapeType; }
92 void setShapeType(
const std::string theType) { myShapeType = theType; }
95 GEOMALGOAPI_EXPORT std::list<GeomAlgoAPI_InfoValue>
values();
113 std::list<GeomAlgoAPI_InfoValue> myVals;
117 Values(
const InfoType theType);
120 const std::string&
html()
const {
return myStr; }
122 void setTranslator(Translator* theTranslator) { myTr = theTranslator; }
123 Translator* translator() {
return myTr; }
126 const std::list<GeomAlgoAPI_InfoValue>&
values()
const {
return myVals; }
129 Values& operator<< (
double theValue);
131 Values& operator<< (
bool theValue);
133 Values& operator<< (
const char* theStr);
135 void addPoint(
const char* theTitle,
const GeomPointPtr& thePoint);
137 void addDirection(
const char* theTitle,
const GeomDirPtr& thePoint);
139 void addNamedValue(
const char* theName,
const double theValue);
141 void addNamedValue(
const char* theName,
const bool theValue);
143 void addGroupName(
const char* theName);
147 void processShape(Values& theVals);
150 void processEdge(Values& theVals, GeomEdgePtr theEdge);
153 void processFace(Values& theVals, GeomFacePtr theFace);
Keeps values of different possible types, used in python shapeInfo.
Definition: GeomAlgoAPI_ShapeInfo.h:35
A translator to the current language is needed for HTML export.
Definition: GeomAlgoAPI_ShapeInfo.h:79
Provides information about shapes in textual (HTML for Information Panel) or a list of parameters ord...
Definition: GeomAlgoAPI_ShapeInfo.h:66
std::list< GeomAlgoAPI_InfoValue > values()
Returns a list of shape information values.
Definition: GeomAlgoAPI_ShapeInfo.cpp:47
void setShapeType(const std::string theType)
Sets the shape type.
Definition: GeomAlgoAPI_ShapeInfo.h:92
std::string html(Translator *theTranslator)
Returns an HTML text of a shape info.
Definition: GeomAlgoAPI_ShapeInfo.cpp:38
const std::string & shapeType()
Returns the detected shape type, or empty string.
Definition: GeomAlgoAPI_ShapeInfo.h:89
GeomAlgoAPI_ShapeInfo(const std::shared_ptr< GeomAPI_Shape > theShape)
Initializes a parameters input by an input shape.
Definition: GeomAlgoAPI_ShapeInfo.h:73
PointPtr addPoint(const std::shared_ptr< ModelAPI_Document > &thePart, const ModelHighAPI_Double &theX, const ModelHighAPI_Double &theY, const ModelHighAPI_Double &theZ)
Create Point feature.
Definition: ConstructionAPI_Point.cpp:353