29 #include <dtkCoreSupport/dtkAbstractViewFactory.h>
32 class axlAbstractViewPrivate
47 disconnect(d->view_controller, SIGNAL(
inserted()),
this, SIGNAL(
inserted()));
49 delete d->view_controller;
57 DTK_DEFAULT_IMPLEMENTATION;
66 DTK_DEFAULT_IMPLEMENTATION;
70 return QList<axlAbstractActor *>();
75 DTK_DEFAULT_IMPLEMENTATION;
82 DTK_DEFAULT_IMPLEMENTATION;
89 DTK_DEFAULT_IMPLEMENTATION;
91 Q_UNUSED(useDefaultLight);
94 void axlAbstractView::setLight(
int i,
bool hide,
double *position,
double *ambiant,
double *diffuse,
double *specular,
int exponent)
96 DTK_DEFAULT_IMPLEMENTATION;
110 return d->view_controller->actorField(axlData);
112 return d->view_controller->actor(data);
121 if(dataField && actorField)
122 d->view_controller->insertField(dataField, actorField);
124 d->view_controller->insert(data, actor);
129 d->view_controller->remove(data);
135 d->view_controller->removeField(dataField);
140 return d->view_controller;
145 DTK_DEFAULT_IMPLEMENTATION;
150 DTK_DEFAULT_IMPLEMENTATION;
155 DTK_DEFAULT_IMPLEMENTATION;
160 DTK_DEFAULT_IMPLEMENTATION;
165 DTK_DEFAULT_IMPLEMENTATION;
170 DTK_DEFAULT_IMPLEMENTATION;
175 DTK_DEFAULT_IMPLEMENTATION;
180 DTK_DEFAULT_IMPLEMENTATION;
189 DTK_DEFAULT_IMPLEMENTATION;
194 if(dynamic_cast<axlAbstractSurfaceBSpline *>(data))
195 d->view_controller->actor(data)->onSamplingChanged();
200 d->view_controller->actor(data)->setShader(isophoteShaderXml);
205 d->view_controller->actor(data)->onControlPointChanged();
212 if(dynamic_cast<axlAbstractCurveBSpline *>(data))
213 d->view_controller->actor(data)->onTubeFilterRadiusChanged(radius);
215 d->view_controller->actor(data)->setSize(radius);
222 if(dynamic_cast<axlAbstractSurfaceBSpline *>(data))
223 d->view_controller->actor(data)->setShaderFromString(isophoteShaderXml);
228 d->view_controller->actor(data)->onUpdateGeometry();
234 d->view_controller->actor(data)->setOpacity(opacity);
239 d->view_controller->actor(data)->setSize(size);
244 d->view_controller->actor(data)->setColor(red, green, blue);
260 d->view_controller->actor(data)->setColor(color.red(), color.green(), color.blue());
261 }
else if (channel == 1) {
263 d->view_controller->actor(data)->setOpacity(opacity);
264 }
else if (channel == 2) {
266 d->view_controller->actor(data)->setShader(xmlFile);
267 }
else if (channel == 3) {
288 d->view_controller->actor(data)->setInterpolation(interpolation);
293 d->view_controller->actor(data)->onModeChanged(mode);
301 d->view_controller->actor(data)->show();
302 if(
axlDataDynamic* axlData = dynamic_cast<axlDataDynamic*>(data)){
303 int indiceOutput = axlData->numberOfChannels();
304 for(
int i = 0; i < indiceOutput; i++){
305 d->view_controller->actor(axlData->outputs(i))->show();
310 if(d->view_controller->actor(data)->parent()){
312 d->view_controller->actor(data)->parent()->show();
320 d->view_controller->actor(data)->hide();
322 if(
axlDataDynamic* axlData = dynamic_cast<axlDataDynamic*>(data)){
323 int indiceOutput = axlData->numberOfChannels();
324 for(
int i = 0; i < indiceOutput; i++){
325 d->view_controller->actor(axlData->outputs(i))->hide();
330 if(d->view_controller->actor(data)->parent()){
332 d->view_controller->actor(data)->parent()->hide();
352 if (!dynamic_cast<axlAbstractData *>(data)->fields().isEmpty()) {
353 foreach (
axlAbstractField * field,dynamic_cast<axlAbstractData *>(data)->fields() ) {
357 d->view_controller->actorField(field)->displayAsNoneScalar();
359 d->view_controller->actorField(field)->displayAsNoneVector();
372 QList<axlAbstractActor *> actorSetToRemoved;
373 QList<axlAbstractActorField *> actorSetFieldToRemoved;
375 for(
int i = 0 ; i < dataSetToRemoved .size() ; i++)
378 actorSetToRemoved <<
actor;
380 if (
axlAbstractData* data = dynamic_cast<axlAbstractData*>(dataSetToRemoved.value(i))){
383 actorSetFieldToRemoved <<
actor;
394 return d->view_controller->size();
404 Q_UNUSED(resolution);
406 DTK_DEFAULT_IMPLEMENTATION;
413 DTK_DEFAULT_IMPLEMENTATION;
420 DTK_DEFAULT_IMPLEMENTATION;
425 DTK_DEFAULT_IMPLEMENTATION;
432 Q_UNUSED(parallelScale);
434 DTK_DEFAULT_IMPLEMENTATION;
439 DTK_DEFAULT_IMPLEMENTATION;
446 DTK_DEFAULT_IMPLEMENTATION;
453 DTK_DEFAULT_IMPLEMENTATION;
460 DTK_DEFAULT_IMPLEMENTATION;
467 DTK_DEFAULT_IMPLEMENTATION;
478 DTK_DEFAULT_IMPLEMENTATION;
483 DTK_DEFAULT_IMPLEMENTATION;
494 DTK_DEFAULT_IMPLEMENTATION;
499 DTK_DEFAULT_IMPLEMENTATION;
508 DTK_DEFAULT_IMPLEMENTATION;
513 DTK_DEFAULT_IMPLEMENTATION;
522 DTK_DEFAULT_IMPLEMENTATION;
533 if(!d->view_controller->contains(axldata))
536 dtkWarn() <<
"this data has already been inserted";
548 DTK_DEFAULT_IMPLEMENTATION;
556 DTK_DEFAULT_IMPLEMENTATION;
561 DTK_DEFAULT_IMPLEMENTATION;
566 DTK_DEFAULT_IMPLEMENTATION;
571 DTK_DEFAULT_IMPLEMENTATION;
582 Q_UNUSED(axlDataSet);
590 return dtkAbstractViewFactory::instance();
axlViewController * controller(void)
virtual double getCameraViewAngle(void)
virtual void setTrackballInteractor(void)
virtual bool getBackgroundGradient(void)
void dataChangedByProperty(dtkAbstractData *data, int channel)
Modify the right property, which is defined by the channel number :
virtual void setCameraPosition(double x, double y, double z)
virtual void onShowAxis(bool show)
void onActorVisibilityChanged(dtkAbstractData *data, bool actorVisibility)
virtual void setJoystickInteractor(void)
virtual void setParallelCamera(bool parallel)
void dataChangedByGeometry(dtkAbstractData *data)
dtkAbstractViewFactory * getSingletonFactory(void)
virtual ~axlAbstractView(void)
virtual void activeDefaultLigh(bool useDefaultLight)
virtual double * getBackgroundColor(void)
void onLightPositionChanged(double x, double y, double z)
virtual void setCameraViewPositiveX(void)
virtual void updateFieldActor(dtkAbstractData *data)
Use view as input to update fields actors on a data.
void onGridResolutionChanged(int resolution)
void onStateChanged(dtkAbstractData *data, int mode)
virtual void removeField(dtkAbstractData *data)
virtual void setObjectCamera(void)
void onInterpolationChanded(dtkAbstractData *data, int interpolation)
void dataChangedByColor(dtkAbstractData *data, double red, double green, double blue)
virtual double * getCameraFocalPoint(void)
virtual double getParallelScale(void)
virtual void removeSet(QList< axlAbstractActor * > actorSet)
virtual void removeData(dtkAbstractData *data)
void processIsophoteByShader(dtkAbstractData *data, QString isophoteShaderXml)
virtual bool getAxesVisibility(void)
void insertData(axlAbstractData *data)
void onShaderChanged(dtkAbstractData *data, QString isophoteShaderXml)
virtual double * getWorldCameraPosition(void)
virtual void setCameraViewPositiveZ(void)
Class axlDataDynamic defines a dynamic object.
virtual bool getParallelProjection(void)
void ondataSetRemoved(QList< dtkAbstractData * > dataSetToRemoved)
void onControlPointChanged(dtkAbstractData *data)
virtual void update(void)
void showColorMapping(dtkAbstractData *data)
virtual void setCameraUp(double x, double y, double z)
void dataChangedBySize(dtkAbstractData *data, double size)
virtual double * getCameraUp(void)
virtual void setParallelScale(double parallelScale)
virtual axlAbstractActor * actor(dtkAbstractData *data)
virtual void onUpdateActorField(QList< axlAbstractData * > axlDataSet, QString fieldName)
virtual void setGrid(bool isGridX, bool isGridY, bool isGridZ)
virtual void setCameraViewDefaut(void)
Class axlAbstractField defines an API for arrays of numeric data.
virtual void setCameraViewNegativeZ(void)
virtual void setWorldCamera(void)
virtual void setCameraViewNegativeX(void)
virtual void setSize(double size)
virtual void add(dtkAbstractData *data)
Use view as input to open a data in axel.
virtual axlAbstractActor * insert(axlAbstractData *data)
void lightPositionChanged(double x, double y, double z)
virtual void onBackgroundGradientChange(bool gradient)
void dataChangedByOpacity(dtkAbstractData *data, double opacity)
virtual QList< axlAbstractActor * > insertSet(QList< axlAbstractData * > dataSet)
QList< axlAbstractField * > fields(void)
virtual void setCameraViewNegativeY(void)
virtual void setCameraFocalPoint(double x, double y, double z)
virtual void setCameraViewAngle(double angle)
void onTubeFilterRadiusChanged(dtkAbstractData *data, double radius)
virtual void setCameraViewPositiveY(void)
Class axlAbstractData defines an API for all type of axel data.
virtual void setLight(int i, bool hide, double *position, double *ambiant, double *diffuse, double *specular, int exponent)
virtual void removeSetFields(QList< axlAbstractActorField * > actorSet)
double angle(axlPoint vCompute, axlPoint vRef, axlPoint normal)