Developer documentation | Axl-2.5.1

axlAbstractView.h
Go to the documentation of this file.
1 /* axlAbstractView.cpp ---
2  *
3  * Author: Meriadeg Perrinel
4  * Copyright (C) 2008 - Meriadeg Perrinel, Inria.
5  * Created: Tue Nov 9 16:58:59 2010 (+0100)
6  * Version: $Id$
7  * Last-Updated: Tue Nov 9 17:09:38 2010 (+0100)
8  * By: Meriadeg Perrinel
9  * Update #: 19
10  */
11 
12 /* Commentary:
13  *
14  */
15 
16 /* Change log:
17  *
18  */
19 
20 #ifndef AXLABSTRACTVIEW_H
21 #define AXLABSTRACTVIEW_H
22 
23 #include "axlAbstractActor.h"
24 #include "axlAbstractData.h"
25 #include "axlCoreExport.h"
26 #include "axlViewController.h"
27 
28 #include <dtkCoreSupport/dtkAbstractView.h>
29 #include <dtkCoreSupport/dtkAbstractData.h>
30 
31 #define AXL_PROPERTY_COLOR 0
32 #define AXL_PROPERTY_OPACITY 1
33 #define AXL_PROPERTY_SHADER 2
34 #define AXL_PROPERTY_SIZE 3
35 
36 class dtkAbstractViewFactory;
37 
38 class axlAbstractViewPrivate;
39 
40 class AXLCORE_EXPORT axlAbstractView : public dtkAbstractView
41 {
42  Q_OBJECT
43 
44 public:
45  axlAbstractView(void);
46  virtual ~axlAbstractView(void);
47 
48  virtual axlAbstractActor *insert(axlAbstractData *data);
49  virtual QList<axlAbstractActor *> insertSet(QList<axlAbstractData *> dataSet);
50  virtual void removeSet(QList<axlAbstractActor *> actorSet);
51  virtual void removeSetFields(QList<axlAbstractActorField *> actorSet);
52 
53  virtual axlAbstractActor *actor(dtkAbstractData *data);
54 
55  virtual void insert(dtkAbstractData *data, axlAbstractActor *actor);
56  virtual void removeData(dtkAbstractData *data);
57  virtual void removeField(dtkAbstractData *data);
58 
59  virtual void activeDefaultLigh(bool useDefaultLight);
60  virtual void setLight(int i, bool hide, double *position, double *ambiant, double *diffuse, double *specular, int exponent);
61 
62  virtual int size(void);
63  virtual QString description(void) const { return "axlAbstractView"; }
64 
65  axlViewController *controller(void);
66 
67  virtual void setCameraViewDefaut(void);
68  virtual void setCameraViewNegativeX(void);
69  virtual void setCameraViewPositiveX(void);
70  virtual void setCameraViewNegativeY(void);
71  virtual void setCameraViewPositiveY(void);
72  virtual void setCameraViewNegativeZ(void);
73  virtual void setCameraViewPositiveZ(void);
74  virtual void setParallelCamera(bool parallel);
75  virtual void setCameraPosition(double x, double y, double z);
76  virtual double *getCameraFocalPoint(void);
77  virtual void setCameraFocalPoint(double x, double y, double z);
78  virtual double *getCameraUp(void);
79  virtual void setCameraUp(double x, double y, double z);
80  virtual double getCameraViewAngle(void);
81  virtual void setCameraViewAngle(double angle);
82  virtual double *getWorldCameraPosition(void);
83  virtual bool getAxesVisibility(void);
84  virtual bool getParallelProjection(void);
85  virtual bool getBackgroundGradient(void);
86  virtual void setParallelScale(double parallelScale);
87  virtual double getParallelScale(void);
88 
89 
90 
91  virtual void setGrid(bool isGridX, bool isGridY, bool isGridZ);
92 
93  dtkAbstractViewFactory *getSingletonFactory(void);
94 
95 
96 signals:
97  void inserted(void);
98  void stateChanged(dtkAbstractData *data, int mode);
99  void lightPositionChanged(double x, double y, double z);
100  void insertData(axlAbstractData *data);
101 
102 public slots:
103  void onStateChanged(dtkAbstractData *data, int mode);
104  void showColorMapping(dtkAbstractData *data);
105  void onShaderChanged(dtkAbstractData *data, QString isophoteShaderXml);
106  void onControlPointChanged(dtkAbstractData *data);
107  void onTubeFilterRadiusChanged(dtkAbstractData *data, double radius);
108  void processIsophoteByShader(dtkAbstractData *data, QString isophoteShaderXml);
109  void dataChangedByGeometry(dtkAbstractData *data);
110  void dataChangedByProperty(dtkAbstractData *data, int channel);
111  void dataChangedByOpacity(dtkAbstractData *data, double opacity);
112  void dataChangedBySize(dtkAbstractData *data, double size);
113  void dataChangedByColor(dtkAbstractData *data, double red, double green, double blue);
114  void onActorVisibilityChanged(dtkAbstractData *data, bool actorVisibility);
115  void ondataSetRemoved(QList<dtkAbstractData *> dataSetToRemoved);
116  void onLightPositionChanged(double x, double y, double z);
117  void onGridResolutionChanged(int resolution);
118 // void onShowAxis(bool show);
119  virtual void onUpdateActorField(QList<axlAbstractData *> axlDataSet, QString fieldName);
120  void onInterpolationChanded(dtkAbstractData*data, int interpolation);
121 
122 
123 
124 public slots:
125  virtual void onShowAxis(bool show);
126  virtual void onBackgroundGradientChange(bool gradient);
127  virtual void setWorldCamera(void);
128  virtual void setObjectCamera(void);
129  virtual void setTrackballInteractor(void);
130  virtual void setJoystickInteractor(void);
131  virtual double *getBackgroundColor(void);
132 
133 public:
134  virtual void update(void);
135 
136 
137 
138 public :
139  // useful fron python interpreter
140  virtual void add(dtkAbstractData *data);
141 
142  virtual void updateFieldActor(dtkAbstractData *data);
143 
144 private:
145  axlAbstractViewPrivate *d;
146 };
147 
148 #endif // AXLABSTRACTVIEW_H
virtual QString description(void) const
#define AXLCORE_EXPORT
Class axlAbstractData defines an API for all type of axel data.
double angle(axlPoint vCompute, axlPoint vRef, axlPoint normal)