SHAPER 9.16.0
InitializationPlugin_Plugin.h
1// Copyright (C) 2014-2026 CEA, EDF
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef INITIALIZATIONPLUGIN_PLUGIN_H_
21#define INITIALIZATIONPLUGIN_PLUGIN_H_
22
23#include <InitializationPlugin.h>
24#include <ModelAPI_Feature.h>
25
26#include <Events_Loop.h>
27
29
37{
38 public:
40 INITIALIZATIONPLUGIN_EXPORT InitializationPlugin_Plugin();
42 INITIALIZATIONPLUGIN_EXPORT virtual ~InitializationPlugin_Plugin() {}
45 INITIALIZATIONPLUGIN_EXPORT virtual void processEvent(
46 const std::shared_ptr<Events_Message>& theMessage);
47
48 protected:
54 FeaturePtr createPlane(DocumentPtr theDoc, double theX, double theY, double theZ);
61 FeaturePtr createPoint(DocumentPtr theDoc, const std::wstring& theName,
62 double theX, double theY, double theZ);
63
70 FeaturePtr createAxis(DocumentPtr theDoc, FeaturePtr theOrigin,
71 double theX, double theY, double theZ);
72
74 void createPart(DocumentPtr thePartSet);
75
76 private:
77 std::shared_ptr<InitializationPlugin_EvalListener> myEvalListener;
78 bool myInitDataModel;
79 bool myCreatePartOnStart;
80};
81
82#endif
83
Base interface for any event listener.
Definition: Events_Listener.h:37
Class which process the events from the event loop.
Definition: InitializationPlugin_EvalListener.h:39
This class is represents a plugin.
Definition: InitializationPlugin_Plugin.h:37
FeaturePtr createAxis(DocumentPtr theDoc, FeaturePtr theOrigin, double theX, double theY, double theZ)
Creates an axis which is started from origin point.
Definition: InitializationPlugin_Plugin.cpp:181
virtual INITIALIZATIONPLUGIN_EXPORT void processEvent(const std::shared_ptr< Events_Message > &theMessage)
Process the ModelAPI_DocumentCreatedMessage to fulfill a document from the message with origin and pl...
Definition: InitializationPlugin_Plugin.cpp:60
void createPart(DocumentPtr thePartSet)
Creates and activates a new part in PartSet document.
Definition: InitializationPlugin_Plugin.cpp:210
FeaturePtr createPlane(DocumentPtr theDoc, double theX, double theY, double theZ)
Creates a plane by given parameters A, B, C.
Definition: InitializationPlugin_Plugin.cpp:129
FeaturePtr createPoint(DocumentPtr theDoc, const std::wstring &theName, double theX, double theY, double theZ)
Creates the origin point in (0,0,0)
Definition: InitializationPlugin_Plugin.cpp:160
INITIALIZATIONPLUGIN_EXPORT InitializationPlugin_Plugin()
Creates plug-in and registers it in the Event Loop.
Definition: InitializationPlugin_Plugin.cpp:44
virtual INITIALIZATIONPLUGIN_EXPORT ~InitializationPlugin_Plugin()
Destructs the plugin.
Definition: InitializationPlugin_Plugin.h:42