SHAPER  9.12.0
InitializationPlugin_Plugin Class Reference

This class is represents a plugin. More...

Inheritance diagram for InitializationPlugin_Plugin:
Inheritance graph

Public Member Functions

INITIALIZATIONPLUGIN_EXPORT InitializationPlugin_Plugin ()
 Creates plug-in and registers it in the Event Loop. More...
 
virtual INITIALIZATIONPLUGIN_EXPORT ~InitializationPlugin_Plugin ()
 Destructs the plugin. More...
 
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 planes. More...
 
virtual EVENTS_EXPORT bool groupMessages ()
 Listener that needs mostly grouped messages received returns true in this method. More...
 

Protected Member Functions

FeaturePtr createPlane (DocumentPtr theDoc, double theX, double theY, double theZ)
 Creates a plane by given parameters A, B, C. More...
 
FeaturePtr createPoint (DocumentPtr theDoc, const std::wstring &theName, double theX, double theY, double theZ)
 Creates the origin point in (0,0,0) More...
 
FeaturePtr createAxis (DocumentPtr theDoc, FeaturePtr theOrigin, double theX, double theY, double theZ)
 Creates an axis which is started from origin point. More...
 
void createPart (DocumentPtr thePartSet)
 Creates and activates a new part in PartSet document. More...
 
void groupWhileFlush (const std::shared_ptr< Events_Message > &theMessage)
 Allows to group messages while they are flushed (for flush for groupMessages=true listeners) More...
 
EVENTS_EXPORT void flushGrouped (const Events_ID &theID)
 Sends myGroups on flush finish. More...
 

Detailed Description

This class is represents a plugin.

It's aim is to fulfill the newly created documents with the "origin" construction point (0,0,0) and base planes (x0y, z0y, x0z)

Constructor & Destructor Documentation

◆ InitializationPlugin_Plugin()

InitializationPlugin_Plugin::InitializationPlugin_Plugin ( )

Creates plug-in and registers it in the Event Loop.

◆ ~InitializationPlugin_Plugin()

virtual INITIALIZATIONPLUGIN_EXPORT InitializationPlugin_Plugin::~InitializationPlugin_Plugin ( )
inlinevirtual

Destructs the plugin.

Member Function Documentation

◆ processEvent()

void InitializationPlugin_Plugin::processEvent ( const std::shared_ptr< Events_Message > &  theMessage)
virtual

Process the ModelAPI_DocumentCreatedMessage to fulfill a document from the message with origin and planes.

Issue 431: for the current moment create planes only in the module document, Later if it is needed we may create special initial planes in Parts (may be different)

Implements Events_Listener.

◆ createPlane()

FeaturePtr InitializationPlugin_Plugin::createPlane ( DocumentPtr  theDoc,
double  theX,
double  theY,
double  theZ 
)
protected

Creates a plane by given parameters A, B, C.

Parameters
theDoc- document to contain a "plane" feature
theX- determines if X is 0 or not
theY- determines if Y is 0 or not
theZ- determines if Z is 0 or not

◆ createPoint()

FeaturePtr InitializationPlugin_Plugin::createPoint ( DocumentPtr  theDoc,
const std::wstring &  theName,
double  theX,
double  theY,
double  theZ 
)
protected

Creates the origin point in (0,0,0)

Parameters
theDoc- document to contain a "point" feature
theName- name of the point
theX- X coordinate
theY- Y coordinate
theZ- Z coordinate

◆ createAxis()

FeaturePtr InitializationPlugin_Plugin::createAxis ( DocumentPtr  theDoc,
FeaturePtr  theOrigin,
double  theX,
double  theY,
double  theZ 
)
protected

Creates an axis which is started from origin point.

Parameters
theDoc- document to contain an "axis" feature
theOrigin- origin point feature
theX- X of direction point
theY- Y of direction point
theZ- Z of direction point

◆ createPart()

void InitializationPlugin_Plugin::createPart ( DocumentPtr  thePartSet)
protected

Creates and activates a new part in PartSet document.

◆ groupMessages()

virtual EVENTS_EXPORT bool Events_Listener::groupMessages ( )
inlinevirtualinherited

Listener that needs mostly grouped messages received returns true in this method.

In this case during the message is flushed, all the new messages are grouped, not sended immideately and then sent in the end of flush.

Reimplemented in SketchSolver_Manager, and SketchPlugin_OverConstraintsResolver.

◆ groupWhileFlush()

void Events_Listener::groupWhileFlush ( const std::shared_ptr< Events_Message > &  theMessage)
protectedinherited

Allows to group messages while they are flushed (for flush for groupMessages=true listeners)

◆ flushGrouped()

void Events_Listener::flushGrouped ( const Events_ID theID)
protectedinherited

Sends myGroups on flush finish.