)
SET(PROJECT_LIBRARIES
+ Config
ModelAPI
GeomAPI
GeomAlgoAPI
INSTALL(FILES ${XML_RESOURCES} DESTINATION plugins)
INCLUDE_DIRECTORIES(
+ ../Config
../ModelAPI
../GeomAPI
../GeomAlgoAPI
#include "ConstructionPlugin_Axis.h"
+#include <Config_PropManager.h>
+
#include <ModelAPI_AttributeSelection.h>
#include <ModelAPI_ResultConstruction.h>
void ConstructionPlugin_Axis::customisePresentation(AISObjectPtr thePrs)
{
- thePrs->setColor(0, 0, 0);
+ std::vector<int> aRGB = Config_PropManager::color("Visualization", "construction_axis_color",
+ CONSTRUCTION_AXIS_COLOR);
+ thePrs->setColor(aRGB[0], aRGB[1], aRGB[2]);
thePrs->setLineStyle(3);
thePrs->redisplay();
}
\ No newline at end of file
/// attribute name for second point
const std::string POINT_ATTR_SECOND = "secondPoint";
+#define CONSTRUCTION_AXIS_COLOR "#000000"
+
/**\class ConstructionPlugin_Axis
* \ingroup Plugins
* \brief Feature for creation of the new axis in PartSet.
#include "ConstructionPlugin_Plane.h"
+#include <Config_PropManager.h>
+
#include <ModelAPI_AttributeSelection.h>
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_ResultConstruction.h>
void ConstructionPlugin_Plane::customisePresentation(AISObjectPtr thePrs)
{
- thePrs->setColor(50, 255, 50);
+ std::vector<int> aRGB = Config_PropManager::color("Visualization", "construction_plane_color",
+ CONSTRUCTION_PLANE_COLOR);
+ thePrs->setColor(aRGB[0], aRGB[1], aRGB[2]);
thePrs->setTransparensy(0.6);
}
\ No newline at end of file
* \ingroup Plugins
* \brief Feature for creation of the new planar surface in PartSet.
*/
+#define CONSTRUCTION_PLANE_COLOR "#32FF32"
+
+
class ConstructionPlugin_Plane : public ModelAPI_Feature, public GeomAPI_ICustomPrs
{
public:
#include "ConstructionPlugin_Axis.h"
#include "ConstructionPlugin_Plane.h"
+#include <Config_PropManager.h>
+
#include <ModelAPI_Session.h>
#include <ModelAPI_Document.h>
{
// register this plugin
ModelAPI_Session::get()->registerPlugin(this);
+
+ // register construction properties
+ Config_PropManager::registerProp("Visualization", "construction_plane_color", "Construction plane color",
+ Config_Prop::Color, CONSTRUCTION_PLANE_COLOR);
+
+ Config_PropManager::registerProp("Visualization", "construction_point_color", "Construction point color",
+ Config_Prop::Color, CONSTRUCTION_POINT_COLOR);
+ Config_PropManager::registerProp("Visualization", "construction_axis_color", "Construction axis color",
+ Config_Prop::Color, CONSTRUCTION_AXIS_COLOR);
}
FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID)
#include <GeomAlgoAPI_PointBuilder.h>
#include <GeomAPI_Pnt.h>
+#include <Config_PropManager.h>
+
using namespace std;
ConstructionPlugin_Point::ConstructionPlugin_Point()
aConstr->setShape(GeomAlgoAPI_PointBuilder::point(aPnt));
setResult(aConstr);
}
+
+void ConstructionPlugin_Point::customisePresentation(AISObjectPtr thePrs)
+{
+ std::vector<int> aRGB = Config_PropManager::color("Visualization", "construction_point_color",
+ CONSTRUCTION_POINT_COLOR);
+ thePrs->setColor(aRGB[0], aRGB[1], aRGB[2]);
+ thePrs->redisplay();
+}
\ No newline at end of file
#include "ConstructionPlugin.h"
#include <ModelAPI_Feature.h>
+#include <GeomAPI_ICustomPrs.h>
+
/// Point kind
const std::string CONSTRUCTION_POINT_KIND("Point");
/// attribute name for Z coordinate
const std::string POINT_ATTR_Z = "z";
+#define CONSTRUCTION_POINT_COLOR "#ffff00"
+
/**\class ConstructionPlugin_Point
* \ingroup Plugins
* \brief Feature for creation of the new part in PartSet.
*/
-class ConstructionPlugin_Point : public ModelAPI_Feature
+class ConstructionPlugin_Point : public ModelAPI_Feature, public GeomAPI_ICustomPrs
{
public:
/// Returns the kind of a feature
/// Use plugin manager for features creation
ConstructionPlugin_Point();
+
+ /// Modifies the given presentation in the custom way.
+ virtual void customisePresentation(AISObjectPtr thePrs);
+
};
#endif