1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #ifndef INITIALIZATIONPLUGIN_PLUGIN_H_
4 #define INITIALIZATIONPLUGIN_PLUGIN_H_
6 #include <InitializationPlugin.h>
8 #include <ModelAPI_Feature.h>
10 #include <Events_Loop.h>
12 /**\class InitializationPlugin_Plugin
14 * This class is represents a plugin.
15 * It's aim is to fulfill the newly created documents with the "origin"
16 * construction point (0,0,0) and base planes (x0y, z0y, x0z)
18 class INITIALIZATIONPLUGIN_EXPORT InitializationPlugin_Plugin : public Events_Listener
21 /// Creates plug-in and registers it in the Event Loop
22 InitializationPlugin_Plugin();
23 /// Destructs the plugin
24 virtual ~InitializationPlugin_Plugin() {}
25 /// Process the ModelAPI_DocumentCreatedMessage to fulfill a document
26 /// from the message with origin and planes
27 virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
30 /// Creates a plane by given parameters A, B, C
31 /// \param theDoc - document to contain a "plane" feature
32 /// \param theX - determines if X is 0 or not
33 /// \param theY - determines if Y is 0 or not
34 /// \param theZ - determines if Z is 0 or not
35 FeaturePtr createPlane(DocumentPtr theDoc, double theX, double theY, double theZ);
36 /// Creates the origin point in (0,0,0)
37 /// \param theDoc - document to contain a "point" feature
38 /// \param theName - name of the point
39 /// \param theX - X coordinate
40 /// \param theY - Y coordinate
41 /// \param theZ - Z coordinate
42 FeaturePtr createPoint(DocumentPtr theDoc, const std::string& theName,
43 double theX, double theY, double theZ);
45 /// Creates an axis which is started from origin point
46 /// \param theDoc - document to contain an "axis" feature
47 /// \param theOrigin - origin point feature
48 /// \param theX - X of direction point
49 /// \param theY - Y of direction point
50 /// \param theZ - Z of direction point
51 FeaturePtr createAxis(DocumentPtr theDoc, FeaturePtr theOrigin,
52 double theX, double theY, double theZ);