Developer documentation | Axl-2.5.1

axlInspectorActorFactory.cpp
Go to the documentation of this file.
1 /* axlInspectorActorFactory.cpp ---
2  *
3  * Author: Anais Ducoffe
4  * Copyright (C) 2013 - Anais Ducoffe, Inria.
5  */
6 
7 
8 /* Commentary:
9  *
10  */
11 
12 /* Change log:
13  *
14  */
15 
17 
18 //all actor types
19 #include "axlActorPoint.h"
20 #include "axlActorCone.h"
21 #include "axlActorCylinder.h"
22 #include "axlActorEllipsoid.h"
23 #include "axlActorLine.h"
24 #include "axlActorPlane.h"
25 #include "axlActorSphere.h"
26 #include "axlActorTorus.h"
27 #include "axlActorDataDynamic.h"
28 #include "axlActorCurveBSpline.h"
29 #include "axlActorSurfaceBSpline.h"
30 #include "axlActorVolumeBSpline.h"
31 #include "axlActorShapeBSpline.h"
32 #include "axlActorComposite.h"
33 #include "axlActorLine.h"
34 #include "axlActorPlane.h"
35 #include "axlActorSphere.h"
36 #include "axlActorTorus.h"
37 #include "axlActorDataDynamic.h"
38 #include "axlActorCurveBSpline.h"
39 #include "axlActorSurfaceBSpline.h"
40 #include "axlActorVolumeBSpline.h"
41 #include "axlActorComposite.h"
42 #include "axlActorMesh.h"
43 
44 // /////////////////////////////////////////////////////////////////
45 //
46 // /////////////////////////////////////////////////////////////////
47 
49 {
51 }
52 
54 {
55 
56 }
57 
59 {
61 }
62 
64 {
66 }
67 
69 {
70  qDebug()<<"axlInspectorActorInterface::setData : Default implementation";
71 }
72 
73 // /////////////////////////////////////////////////////////////////
74 //
75 // /////////////////////////////////////////////////////////////////
76 
77 class axlInspectorActorFactoryPrivate
78 {
79 public:
81 };
82 
84 {
85  if(!s_instance)
87 
88  return s_instance;
89 }
90 
91 bool axlInspectorActorFactory::registerInspectorActor(const QString& interface_name, axlInspectorActorCreator func)
92 {
93  if(!d->creators.contains(interface_name))
94  d->creators.insert(interface_name, func);
95 
96  return true;
97 }
98 
99 
101 {
102 
103  d->creators.insert("axlPoint", createAxlActorPoint);
104  d->creators.insert("axlCone",createAxlActorCone );
105  d->creators.insert("axlCylinder", createAxlActorCylinder);
106  d->creators.insert("axlTorus", createAxlActorTorus);
107  d->creators.insert("axlEllipsoid", createAxlActorEllipsoid);
108  d->creators.insert("axlLine", createAxlActorLine);
109  d->creators.insert("axlPlane", createAxlActorPlane);
110  d->creators.insert("axlSphere", createAxlActorSphere);
111  d->creators.insert("goCurveBSpline", createAxlActorCurveBSpline);
112  d->creators.insert("goSurfaceBSpline", createAxlActorSurfaceBSpline);
113  d->creators.insert("goVolumeBSpline", createAxlActorVolumeBSpline);
114  d->creators.insert("Composite Data", createAxlActorComposite);
115  d->creators.insert("axlDataDynamic",createAxlActorDataDynamic);
116  d->creators.insert("axlMesh", createAxlActorMesh);
117  d->creators.insert("axlShapeBSpline", createAxlActorShapeBSpline);
118 
119 }
120 
121 axlAbstractActor *axlInspectorActorFactory::create(const QString& interface_name)
122 {
123  if(!d->creators.contains(interface_name))
124  return d->creators["axlMesh"]();
125 
126  return d->creators[interface_name]();
127 
128 }
129 
130 axlInspectorActorFactory::axlInspectorActorFactory(void) : QObject(), d(new axlInspectorActorFactoryPrivate)
131 {
132  initialize();
133 
134 }
135 
136 axlInspectorActorFactory::~axlInspectorActorFactory(void)
137 {
138  delete d;
139 
140  d = NULL;
141 }
142 
axlInspectorActorInterface(QWidget *parent=0)
axlAbstractActor * createAxlActorDataDynamic(void)
axlInspectorActorFactory * actorFactorySingleton(void)
axlAbstractActor * createAxlActorEllipsoid(void)
axlAbstractActor * createAxlActorCone(void)
axlAbstractActor * createAxlActorSphere(void)
axlAbstractActor * createAxlActorComposite(void)
axlAbstractActor * createAxlActorSurfaceBSpline(void)
static axlInspectorActorFactory * instance(void)
axlAbstractActor * createAxlActorLine(void)
axlAbstractActor * createAxlActorTorus(void)
virtual void setData(axlAbstractActor *data)
axlAbstractActor * createAxlActorPlane(void)
axlAbstractActor * createAxlActorMesh(void)
bool registerInspectorActor(const QString &interface_name, axlInspectorActorCreator func)
axlAbstractActor * createAxlActorPoint(void)
axlAbstractActor * create(const QString &interface_name)
static axlInspectorActorFactory * s_instance
axlAbstractActor * createAxlActorVolumeBSpline(void)
axlAbstractActor * createAxlActorShapeBSpline(void)
axlAbstractActor * createAxlActorCylinder(void)
axlInspectorActorFactory * m_actorFactorySingleton
void setActorFactorySingleton(axlInspectorActorFactory *actorFactorySingleton)
QHash< QString, axlInspectorActorCreator > axlInspectorActorCreatorHash
axlAbstractActor * createAxlActorCurveBSpline(void)