diff --git a/.travis/install_deps_macos.sh b/.travis/install_deps_macos.sh
index 07172373d2..7488e2af57 100755
--- a/.travis/install_deps_macos.sh
+++ b/.travis/install_deps_macos.sh
@@ -4,8 +4,10 @@
# Note: gmp and boost already installed
#
brew update
-#brew install qt5 doxygen homebrew/science/hdf5 graphviz graphicsmagick fftw eigen homebrew/boneyard/libqglviewer
-brew install qt5 graphicsmagick fftw eigen homebrew/boneyard/libqglviewer
+#brew install qt5 doxygen homebrew/science/hdf5 graphviz graphicsmagick fftw eigen
+brew install qt5 graphicsmagick fftw eigen
+# Explicit install of libqglviewer
+brew install http://liris.cnrs.fr/david.coeurjolly/misc/libqglviewer.rb
## Temporary HDF5 build issue
export BTYPE="$BTYPE -DWITH_HDF5=false" && echo "Disabling HDF5 on MacOS";
diff --git a/ChangeLog.md b/ChangeLog.md
index 3e9e9e61e6..e7a7725f59 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -2,6 +2,11 @@
## New Features / Critical Changes
+- *IO*
+ - New simple way to extend the QGLViewer-based Viewer3D interface,
+ for instance to add callbacks to key or mouse events, or to modify
+ what is drawn on the window.
+ (Jacques-Olivier Lachaud, [#1259](https://github.com/DGtal-team/DGtal/pull/1259))
## Changes
diff --git a/examples/io/viewers/CMakeLists.txt b/examples/io/viewers/CMakeLists.txt
index 3b24a1beb8..4bc568a63c 100644
--- a/examples/io/viewers/CMakeLists.txt
+++ b/examples/io/viewers/CMakeLists.txt
@@ -11,6 +11,7 @@ SET(DGTAL_TESTS_SRC
viewer3D-7bis-planes
viewer3D-9-3Dimages
viewer3D-10-interaction
+ viewer3D-11-extension
demo-kernel-2
)
diff --git a/examples/io/viewers/viewer3D-11-extension.cpp b/examples/io/viewers/viewer3D-11-extension.cpp
new file mode 100644
index 0000000000..e1a2bcc566
--- /dev/null
+++ b/examples/io/viewers/viewer3D-11-extension.cpp
@@ -0,0 +1,132 @@
+/**
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ **/
+
+/**
+ * @file io/viewers/viewer3D-11-extension.cpp
+ * @ingroup examples/3dViewer
+ * @author Jacques-Olivier Lachaud (\c jacques-olivier.lachaud@univ-savoie.fr )
+ * Laboratory of Mathematics (CNRS, UMR 5127), University of Savoie, France
+ *
+ * @date 2017/03/05
+ *
+ * Simple example of class Viewer3D.
+ *
+ * This file is part of the DGtal library.
+ */
+
+/**
+ * Example of extension of Viewer3D interface by deriving the class
+ * Viewer3D::Extension. Here we have added a callback to the
+ * "Shift+R" keypressed event, which adds a point randomly in the domain.
+ *
+ * @see moduleQGLExtension
+ * \example io/viewers/viewer3D-11-extension.cpp
+ * \image html simple3dVisu1.png "Extending the Viewer3D interface: just press Shift+R and you have new points added randomly in the scene."
+ */
+
+///////////////////////////////////////////////////////////////////////////////
+#include
+
+#include "DGtal/base/Common.h"
+#include "DGtal/helpers/StdDefs.h"
+#include "DGtal/io/viewers/Viewer3D.h"
+///////////////////////////////////////////////////////////////////////////////
+
+using namespace std;
+using namespace DGtal;
+using namespace Z3i;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Standard services - public :
+
+
+//! [viewer3D-extension-derivation]
+// Deriving from Viewer3D::Extension to add new callbacks to events.
+struct RandomPointKeyExtension : public Viewer3D::Extension
+{
+ RandomPointKeyExtension() {}
+
+ // Here we override the "key pressed" event, and a point randomly in
+ // the scene if the key "Shift+R" is pressed.
+ virtual bool keyPressEvent ( Viewer& viewer, QKeyEvent * event )
+ {
+ bool handled = false;
+ // Get event modifiers key
+ const Qt::KeyboardModifiers modifiers = event->modifiers();
+ if( ( event->key() == Qt::Key_R ) && ( modifiers == Qt::ShiftModifier ) )
+ {
+ typedef Viewer::KSpace KSpace;
+ Point p = viewer.space().lowerBound();
+ Point q = viewer.space().upperBound();
+ Point d = q - p;
+ Point a( ( rand() % d[ 0 ] ) + p[ 0 ],
+ ( rand() % d[ 1 ] ) + p[ 1 ],
+ ( rand() % d[ 2 ] ) + p[ 2 ] );
+ viewer << a;
+ viewer << Viewer::updateDisplay;
+ trace.info() << "Adding point " << a << std::endl;
+ handled = true;
+ }
+ return handled;
+ }
+
+ // We also override the Viewer3D::init method to add a key
+ // description in the help window.
+ virtual void init( Viewer& viewer )
+ {
+ viewer.setKeyDescription ( Qt::ShiftModifier+Qt::Key_R,
+ "Creates a random digital point." );
+ }
+
+ // We also override the Viewer3D::helpString method to add a
+ // description to the viewer.
+ virtual QString helpString(const Viewer& viewer) const
+ {
+ QString text( " Random point Viewer3D
" );
+ text += "Press Shift+R to add points.";
+ return text;
+ }
+
+};
+//! [viewer3D-extension-derivation]
+
+int main( int argc, char** argv )
+{
+
+ QApplication application(argc,argv);
+
+ Point p1( 0, 0, 0 );
+ Point p2( 5, 5 ,5 );
+ Point p3( 2, 3, 4 );
+ Domain domain( p1, p2 );
+
+ typedef Viewer3D<> MyViewer;
+ KSpace K;
+ K.init( p1, p2, true );
+ //! [viewer3D-extension-set-extension]
+ MyViewer viewer( K );
+ viewer.setExtension( new RandomPointKeyExtension );
+ //! [viewer3D-extension-set-extension]
+ viewer.show();
+ viewer << domain;
+ viewer << p1 << p2 << p3;
+
+ viewer<< MyViewer::updateDisplay;
+ return application.exec();
+}
+// //
+///////////////////////////////////////////////////////////////////////////////
diff --git a/src/DGtal/io/Display3D.h b/src/DGtal/io/Display3D.h
index aa9b01c91b..d09cef774d 100644
--- a/src/DGtal/io/Display3D.h
+++ b/src/DGtal/io/Display3D.h
@@ -896,6 +896,8 @@ namespace DGtal
///
std::set mySelectCallBackFcts;
+ bool myBoundingPtChangedTag = false;
+
//----end of protected datas
// ------------------------- Internals ------------------------------------
diff --git a/src/DGtal/io/Display3D.ih b/src/DGtal/io/Display3D.ih
index c9b429501a..d2c183f41e 100644
--- a/src/DGtal/io/Display3D.ih
+++ b/src/DGtal/io/Display3D.ih
@@ -1191,16 +1191,42 @@ DGtal::Display3D< Space ,KSpace >::updateBoundingBox(const RealPoint &p)
myBoundingPtUp[1]= p[1];
myBoundingPtUp[2]= p[2];
myBoundingPtEmptyTag = false;
+ myBoundingPtChangedTag = true;
}
else
{
- if(p[0] myBoundingPtUp[0]) myBoundingPtUp[0]= p[0];
- if(p[1] >myBoundingPtUp[1]) myBoundingPtUp[1]= p[1];
- if(p[2] >myBoundingPtUp[2]) myBoundingPtUp[2]= p[2];
+ if(p[0] myBoundingPtUp[0])
+ {
+ myBoundingPtUp[0]= p[0];
+ myBoundingPtChangedTag = true;
+ }
+ if(p[1] >myBoundingPtUp[1])
+ {
+ myBoundingPtUp[1]= p[1];
+ myBoundingPtChangedTag = true;
+ }
+ if(p[2] >myBoundingPtUp[2])
+ {
+ myBoundingPtUp[2]= p[2];
+ myBoundingPtChangedTag = true;
+ }
}
}
diff --git a/src/DGtal/io/doc/moduleQGLExtension.dox b/src/DGtal/io/doc/moduleQGLExtension.dox
new file mode 100644
index 0000000000..16a64d498c
--- /dev/null
+++ b/src/DGtal/io/doc/moduleQGLExtension.dox
@@ -0,0 +1,88 @@
+
+
+/*
+ * Useful to avoid writing DGtal:: in front of every class.
+ */
+namespace DGtal {
+
+/**
+ * @page moduleQGLExtension Extending the QGLViewer Viewer3D interface
+ *
+ *
+ * This part of the manual describes how to extend the standard
+ * Viewer3D interface of DGtal. For instance, you wish to assign new
+ * handlers keys or to mouse event, or you wish to display or
+ * select other graphical elements. To do that, you just have to write
+ * a class that derived from Viewer3D::Extension and overrides some
+ * methods to get your desired behaviour.
+ *
+ * @author Jacques-Olivier Lachaud
+ *
+ * @since 9.4
+ *
+ * Related examples: viewer3D-11-extension.cpp
+ *
+ * Related modules: \ref moduleQGLInteraction
+ *
+ * [TOC]
+ *
+ * \section QGLExtension_sec1 Extending the standard behavior of Viewer3D
+ *
+ * The Viewer3D interface provides a very handy way of visualising 3D
+ * scenes, digital objects or meshes in DGtal, and is bundled with
+ * many functionalities (like moving the light, selecting some
+ * objects, etc). However it is not directly extensible as is, and,
+ * for several reasons, you cannot derive from the Viewer3D class
+ * directly to add some new functionalities.
+ *
+ * Therefore we provide the class Viewer3D::Extension so that you can
+ * extend the viewer in several ways. The principle is very easy. This
+ * interface provides a set of empty virtual methods so you just have
+ * to override them in order to change the behavior of the viewer. For
+ * instance, you just have to override
+ * Viewer3D::Extension::keyPressEvent to capture other key events. You
+ * can override all the following methods:
+ *
+ * - Viewer3D::Extension::keyPressEvent. This method may be
+ * overloaded to capture other key events.
+ *
+ * - Viewer3D::Extension::drawWithNames. This method is useful for
+ * drawing elements with additional information for selection (see also \ref moduleQGLInteraction).
+ *
+ * - Viewer3D::Extension::draw. This method is useful for drawing elements that are not directly handled by Viewer3D.
+ *
+ * - Viewer3D::Extension::init. This method is useful at initialization (e.g. adding lights manipulators).
+ *
+ * - Viewer3D::Extension::helpString. This method is useful to change the help message.
+ *
+ * - Viewer3D::Extension::postSelection. This method is useful to take
+ * care of mouse selection events.
+ *
+ * - Viewer3D::Extension::mouseMoveEvent. This method is useful to
+ * take care of mouse movements.
+ *
+ * - Viewer3D::Extension::mousePressEvent. This method is useful to
+ * take care of mouse button press events.
+ *
+ * - Viewer3D::Extension::mouseReleaseEvent. This method is useful to
+ * take care of mouse button release events.
+ *
+ * The example below shows how to capture "Shift+R" key pressed
+ * events, so that each time this event occurs random points are added
+ * to the 3D scene.
+ *
+ * @snippet io/viewers/viewer3D-11-extension.cpp viewer3D-extension-derivation
+ *
+ * \section QGLExtension_sec2 Activating your extension in some viewer
+ *
+ * Once you have built a class that derives from Viewer3D::Extension,
+ * it remains to create some instance of this extension and to hand it
+ * to your viewer. This is done by the following lines.
+ *
+ * @snippet io/viewers/viewer3D-11-extension.cpp viewer3D-extension-set-extension
+ *
+ * The viewer will take care of freeing your instanciated extension object.
+ * For a complete example, see viewer3D-11-extension.cpp.
+ */
+
+}
diff --git a/src/DGtal/io/doc/packageIO.dox b/src/DGtal/io/doc/packageIO.dox
index 288efb022d..9b9bd39e7b 100644
--- a/src/DGtal/io/doc/packageIO.dox
+++ b/src/DGtal/io/doc/packageIO.dox
@@ -49,6 +49,7 @@ In this package, we present DGtal tools and utilities to import/export images an
- \ref moduleBoard2D (Jacques-Olivier Lachaud, Nicolas Normand, David Coeurjolly, Martial Tola)
- \ref moduleDisplay3D (Bertrand Kerautret, Martial Tola, Aline Martin, David Coeurjolly)
- \ref moduleQGLInteraction (Jacques-Olivier Lachaud, Bertrand Kerautret)
+ - \ref moduleQGLExtension (Jacques-Olivier Lachaud)
- \ref moduleIO (David Coeurjolly, Bertrand Kerautret, Martial Tola, Pierre Gueth)
@b Package @b Concepts @b Overview
diff --git a/src/DGtal/io/viewers/Viewer3D.h b/src/DGtal/io/viewers/Viewer3D.h
index 6f439ac867..8792a163ad 100644
--- a/src/DGtal/io/viewers/Viewer3D.h
+++ b/src/DGtal/io/viewers/Viewer3D.h
@@ -118,8 +118,8 @@ namespace DGtal
* used to compute the Euclidean coordinate of digital
* objects/khalimksy cells.
*
- * @tparam Space any model of Digital 3D Space
- * @tparam KSpace any mode of Khalimksky 3D space
+ * @tparam TSpace any model of Digital 3D Space
+ * @tparam TKSpace any mode of Khalimksky 3D space
*
* @note You *must* provide a Khalimksy space at instanciation if
* you wish to display cells with the viewer. If you are not going
@@ -127,32 +127,163 @@ namespace DGtal
*
* @see Display3D, Board3DTo2D
*/
- template < typename Space = SpaceND<3>,
- typename KSpace = KhalimskySpaceND<3> >
- class Viewer3D : public QGLViewer, public Display3D
+ template < typename TSpace = SpaceND<3>,
+ typename TKSpace = KhalimskySpaceND<3> >
+ class Viewer3D : public QGLViewer, public Display3D
{
- BOOST_CONCEPT_ASSERT((concepts::CSpace));
+ BOOST_CONCEPT_ASSERT((concepts::CSpace));
//---------------overwritting some functions of Display3D -------------------
// ----------------------- public types ------------------------------
public:
-
- typedef Display3D Display;
+ typedef TSpace Space;
+ typedef TKSpace KSpace;
+ typedef Viewer3D Self;
+ typedef Display3D Display;
typedef typename Display::SelectCallbackFct SelectCallbackFct;
+ typedef typename Display::RealPoint RealPoint;
using Display::getSelectCallback3D;
- typedef typename Display::RealPoint RealPoint;
enum RenderingMode {RenderingDefault, RenderingMetallic, RenderingPlastic, RenderingLambertian };
+ /**
+ * Interface that can be used so that one can extend a few service
+ * of Viewer3D, like keyPressEvent and others. You may thus give an
+ * extension to a Viewer3D by simply handling it a pointer to an
+ * object deriving from this class.
+ */
+ struct Extension {
+ /// The associated viewer.
+ typedef Viewer3D Viewer;
+
+ /// This method may be overloaded to capture other key
+ /// events. It will be called at the beginning of Viewer3D::keyPressEvent.
+ ///
+ /// @param viewer the viewer calling this method
+ /// @param event the key event
+ ///
+ /// @return 'true' if the event was handled (in this case,
+ /// Viewer3D::keyPressEvent will not do anything).
+ virtual bool keyPressEvent ( Viewer& viewer, QKeyEvent * event )
+ {
+ boost::ignore_unused_variable_warning( viewer );
+ boost::ignore_unused_variable_warning( event );
+ return false;
+ }
+
+ /// This method may be overloaded and is called at the beginning
+ /// of Viewer3D::drawWithNames. This method is useful for
+ /// drawing elements with additional information for selection.
+ ///
+ /// @param viewer the viewer calling this method
+ virtual void drawWithNames( Viewer& viewer )
+ {
+ boost::ignore_unused_variable_warning( viewer );
+ }
+
+ /// This method may be overloaded and is called at the beginning
+ /// of Viewer3D::draw. This method is called for drawing
+ /// elements.
+ ///
+ /// @param viewer the viewer calling this method
+ virtual void draw( Viewer& viewer )
+ {
+ boost::ignore_unused_variable_warning( viewer );
+ }
+
+ /// This method may be overloaded and is called at QGLViewer
+ /// initialization. It will be called at the beginning of
+ /// Viewer3D::init.
+ /// @param viewer the viewer calling this method
+ virtual void init(Viewer& viewer)
+ {
+ boost::ignore_unused_variable_warning( viewer );
+ }
+
+ /// This method may be overloaded and is called when pressing
+ /// help. It will be added before Viewer3D::helpString.
+ ///
+ /// @param viewer the viewer calling this method
+ /// @return astring corresponding to the help of the viewer (list of commands, etc)
+ virtual QString helpString(const Viewer& viewer) const
+ {
+ boost::ignore_unused_variable_warning( viewer );
+ return "";
+ }
+
+ /// This method may be overloaded to take care of a mouse
+ /// selection event. It will be called at the beginning of
+ /// Viewer3D::postSelection.
+ ///
+ /// @param viewer the viewer calling this method
+ /// @param point the point clicked by the user in the window
+ ///
+ /// @return 'true' if the event was handled (in this case,
+ /// Viewer3D::postSelection will not do anything).
+ virtual bool postSelection(const Viewer& viewer, const QPoint& point )
+ {
+ boost::ignore_unused_variable_warning( viewer );
+ boost::ignore_unused_variable_warning( point );
+ return false;
+ }
+
+ /// This method may be overloaded to capture other mouse move
+ /// events. It will be called at the beginning of Viewer3D::mouseMoveEvent.
+ ///
+ /// @param viewer the viewer calling this method
+ /// @param event the mouse move event
+ ///
+ /// @return 'true' if the event was handled (in this case,
+ /// Viewer3D::mouseMoveEvent will not do anything).
+ virtual bool mouseMoveEvent(const Viewer& viewer, QMouseEvent* event )
+ {
+ boost::ignore_unused_variable_warning( viewer );
+ boost::ignore_unused_variable_warning( event );
+ return false;
+ }
+
+ /// This method may be overloaded to capture other mouse press
+ /// events. It will be called at the beginning of Viewer3D::mousePressEvent.
+ ///
+ /// @param viewer the viewer calling this method
+ /// @param event the mouse press event
+ ///
+ /// @return 'true' if the event was handled (in this case,
+ /// Viewer3D::mousePressEvent will not do anything).
+ virtual bool mousePressEvent(const Viewer& viewer, QMouseEvent* event )
+ {
+ boost::ignore_unused_variable_warning( viewer );
+ boost::ignore_unused_variable_warning( event );
+ return false;
+ }
+
+ /// This method may be overloaded to capture other mouse release
+ /// events. It will be called at the beginning of Viewer3D::mouseReleaseEvent.
+ ///
+ /// @param viewer the viewer calling this method
+ /// @param event the mouse release event
+ ///
+ /// @return 'true' if the event was handled (in this case,
+ /// Viewer3D::mouseReleaseEvent will not do anything).
+ virtual bool mouseReleaseEvent(const Viewer& viewer, QMouseEvent* event )
+ {
+ boost::ignore_unused_variable_warning( viewer );
+ boost::ignore_unused_variable_warning( event );
+ return false;
+ }
+
+ };
+
// ----------------------- Standard services ------------------------------
public:
/**
* Constructor
*/
- Viewer3D() :QGLViewer(), Display3D()
+ Viewer3D() :QGLViewer(), Display3D(),
+ myExtension( 0 )
{
resize(800,600);
};
@@ -161,11 +292,29 @@ namespace DGtal
*Constructor with a khalimsky space
* @param KSEmb the Khalimsky space
*/
- Viewer3D(const KSpace &KSEmb):QGLViewer(), Display3D(KSEmb)
+ Viewer3D(const KSpace &KSEmb):QGLViewer(), Display3D(KSEmb),
+ myExtension( 0 )
{
resize(800,600);
}
+ /// Sets the extension \a ext to the viewer. The object is
+ /// acquired by the viewer and should be dynamically allocated.
+ /// @param ext any dynamically allocated object deriving from Extension.
+ void setExtension( Extension* ext )
+ {
+ if ( myExtension != 0 ) delete myExtension;
+ myExtension = ext;
+ }
+
+ /// Removes the current extension to the viewer or does nothing if
+ /// no extension was present.
+ void removeExtension()
+ {
+ if ( myExtension != 0 ) delete myExtension;
+ myExtension = 0;
+ }
+
/**
* Set camera position.
* @param ax x position.
@@ -815,6 +964,16 @@ namespace DGtal
public:
+ /// To call the protected method `drawLight`.
+ void drawSomeLight( GLenum light ) const
+ {
+ QGLViewer::drawLight( light );
+ }
+ /// To call the protected method `drawLight`.
+ void drawSomeLight( GLenum light, float zoom ) const
+ {
+ QGLViewer::drawLight( light, zoom );
+ }
@@ -1490,12 +1649,14 @@ namespace DGtal
std::vector myGSImageList;
/// Used to store all the domains
std::vector myImageDomainList;
-
+ /// Stored a possible extension to the viewer (pointer owned).
+ Extension* myExtension;
+
}; // end of class Viewer3D
- template < typename Space, typename KSpace>
+ template < typename TSpace, typename TKSpace>
/**
* Overloads 'operator<<' for displaying objects of class 'Viewer3D'.
* @param out the output stream where the object is written.
@@ -1503,7 +1664,7 @@ namespace DGtal
* @return the output stream after the writing.
*/
std::ostream&
- operator<< ( std::ostream & out, const Viewer3D & object );
+ operator<< ( std::ostream & out, const Viewer3D & object );
} // namespace DGtal
diff --git a/src/DGtal/io/viewers/Viewer3D.ih b/src/DGtal/io/viewers/Viewer3D.ih
index 31781fbdaf..2e2b7732cc 100644
--- a/src/DGtal/io/viewers/Viewer3D.ih
+++ b/src/DGtal/io/viewers/Viewer3D.ih
@@ -64,10 +64,10 @@ using namespace qglviewer;
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
inline
void
-DGtal::Viewer3D::rotateDomain(Image2DDomainD3D &anDom, double angleRotation,
+DGtal::Viewer3D::rotateDomain(Image2DDomainD3D &anDom, double angleRotation,
ImageDirection rotationDir){
DGtal::PointVector<3, int> pt;
pt[0] = (int) (anDom.point1[0]+anDom.point2[0]+anDom.point3[0]+anDom.point4[0])/4.0;
@@ -75,20 +75,20 @@ DGtal::Viewer3D::rotateDomain(Image2DDomainD3D &anDom, double ang
pt[2] = (int) (anDom.point1[2]+anDom.point2[2]+anDom.point3[2]+anDom.point4[2])/4.0;
rotateImageVertex(anDom, angleRotation, rotationDir);
- std::vector::LineD3D> &aVectLine = Viewer3D::myLineSetList.at(anDom.myLineSetIndex);
+ std::vector::LineD3D> &aVectLine = Viewer3D::myLineSetList.at(anDom.myLineSetIndex);
for(unsigned int i = 0; i< aVectLine.size();i++){
- typename DGtal::Display3D::LineD3D &aLine = aVectLine.at(i);
+ typename DGtal::Display3D::LineD3D &aLine = aVectLine.at(i);
rotateLineD3D(aLine, pt, angleRotation, rotationDir );
}
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
template
inline
void
-DGtal::Viewer3D::rotatePoint(TValues &x, TValues &y, TValues &z,
+DGtal::Viewer3D::rotatePoint(TValues &x, TValues &y, TValues &z,
double cx, double cy, double cz,
double angleRotation, ImageDirection rotationDir){
double dx = x-cx; double dy = y-cy; double dz = z-cz;
@@ -109,11 +109,11 @@ DGtal::Viewer3D::rotatePoint(TValues &x, TValues &y, TValues &z,
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
template < typename TContainer >
inline
void
-DGtal::Viewer3D::rotateLineD3D(typename DGtal::Display3D::LineD3D &aLine,
+DGtal::Viewer3D::rotateLineD3D(typename DGtal::Display3D::LineD3D &aLine,
DGtal::PointVector<3, int, TContainer> pt,
double angleRotation, ImageDirection dirRotation){
double dx1 = aLine.point1[0] - pt[0]; double dy1 = aLine.point1[1] - pt[1]; double dz1 = aLine.point1[2] - pt[2];
@@ -144,48 +144,48 @@ DGtal::Viewer3D::rotateLineD3D(typename DGtal::Display3D
+template < typename TSpace, typename TKSpace >
inline
unsigned int
-DGtal::Viewer3D< Space ,KSpace >::getCurrentDomainNumber()
+DGtal::Viewer3D::getCurrentDomainNumber()
{
return myImageDomainList.size();
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
inline
unsigned int
-DGtal::Viewer3D< Space ,KSpace >::getCurrentGLImageNumber()
+DGtal::Viewer3D::getCurrentGLImageNumber()
{
return myGSImageList.size();
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
inline
void
-DGtal::Viewer3D< Space ,KSpace >::addTextureImage(const typename Viewer3D< Space ,KSpace >::TextureImage &image)
+DGtal::Viewer3D::addTextureImage(const typename Viewer3D::TextureImage &image)
{
myGSImageList.push_back(image);
- Display3D< Space, KSpace>::updateBoundingBox(image.point1);
- Display3D< Space, KSpace>::updateBoundingBox(image.point2);
- Display3D< Space, KSpace>::updateBoundingBox(image.point3);
- Display3D< Space, KSpace>::updateBoundingBox(image.point4);
+ Display3D::updateBoundingBox(image.point1);
+ Display3D::updateBoundingBox(image.point2);
+ Display3D::updateBoundingBox(image.point3);
+ Display3D::updateBoundingBox(image.point4);
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
template < typename TImageType, typename TFunctor >
inline
void
-DGtal::Viewer3D< Space ,KSpace >::updateTextureImage(unsigned int imageIndex, const TImageType & image, const TFunctor & aFunctor,
+DGtal::Viewer3D::updateTextureImage(unsigned int imageIndex, const TImageType & image, const TFunctor & aFunctor,
double xTranslation, double yTranslation, double zTranslation,
double rotationAngle, ImageDirection rotationDir)
{
BOOST_CONCEPT_ASSERT(( concepts::CConstImage < TImageType > ));
assert ( imageIndex< myGSImageList.size());
- typename Viewer3D< Space ,KSpace >::TextureImage &anImage = myGSImageList.at(imageIndex);
+ typename Viewer3D::TextureImage &anImage = myGSImageList.at(imageIndex);
Display::updateBoundingBox(RealPoint(anImage.point1[0]+xTranslation,
anImage.point1[1]+yTranslation,
anImage.point1[2]+zTranslation));
@@ -211,21 +211,21 @@ DGtal::Viewer3D< Space ,KSpace >::updateTextureImage(unsigned int imageIndex, co
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
inline
void
-DGtal::Viewer3D< Space ,KSpace >::updateOrientationTextureImage(unsigned int imageIndex,
+DGtal::Viewer3D::updateOrientationTextureImage(unsigned int imageIndex,
double xPosition,
double yPosition,
double zPosition,
ImageDirection newDirection)
{
assert ( imageIndex< myGSImageList.size());
- typename Viewer3D< Space ,KSpace >::TextureImage &anImage = myGSImageList.at(imageIndex);
- Display3D< Space, KSpace>::updateBoundingBox(anImage.point1);
- Display3D< Space, KSpace>::updateBoundingBox(anImage.point2);
- Display3D< Space, KSpace>::updateBoundingBox(anImage.point3);
- Display3D< Space, KSpace>::updateBoundingBox(anImage.point4);
+ typename Viewer3D::TextureImage &anImage = myGSImageList.at(imageIndex);
+ Display3D::updateBoundingBox(anImage.point1);
+ Display3D::updateBoundingBox(anImage.point2);
+ Display3D::updateBoundingBox(anImage.point3);
+ Display3D::updateBoundingBox(anImage.point4);
anImage.updateImageOrientation(newDirection, xPosition, yPosition, zPosition);
if(anImage.myDrawDomain)
{
@@ -236,29 +236,29 @@ DGtal::Viewer3D< Space ,KSpace >::updateOrientationTextureImage(unsigned int ima
}
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
inline
void
-DGtal::Viewer3D::updateEmbeddingTextureImage(unsigned int anImageIndex,
+DGtal::Viewer3D::updateEmbeddingTextureImage(unsigned int anImageIndex,
typename Space::Point aPoint1, typename Space::Point aPoint2,
typename Space::Point aPoint3, typename Space::Point aPoint4)
{
assert ( anImageIndex< myGSImageList.size());
- typename Viewer3D< Space ,KSpace >::TextureImage &anImage = myGSImageList.at(anImageIndex);
- Display3D< Space, KSpace>::updateBoundingBox(aPoint1);
- Display3D< Space, KSpace>::updateBoundingBox(aPoint2);
- Display3D< Space, KSpace>::updateBoundingBox(aPoint3);
- Display3D< Space, KSpace>::updateBoundingBox(aPoint4);
+ typename Viewer3D::TextureImage &anImage = myGSImageList.at(anImageIndex);
+ Display3D::updateBoundingBox(aPoint1);
+ Display3D::updateBoundingBox(aPoint2);
+ Display3D::updateBoundingBox(aPoint3);
+ Display3D::updateBoundingBox(aPoint4);
anImage.updateImage3DEmbedding(aPoint1, aPoint2, aPoint3, aPoint4);
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
inline
void
-DGtal::Viewer3D< Space ,KSpace >::TextureImage::updateImageOrientation( ImageDirection normalDir,
+DGtal::Viewer3D::TextureImage::updateImageOrientation( ImageDirection normalDir,
double xBottomLeft, double yBottomLeft, double zBottomLeft)
{
if(normalDir==zDirection)
@@ -283,10 +283,10 @@ DGtal::Viewer3D< Space ,KSpace >::TextureImage::updateImageOrientation( ImageDir
myDirection=normalDir;
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
inline
void
-DGtal::Viewer3D< Space ,KSpace >::Image2DDomainD3D::updateDomainOrientation(ImageDirection normalDir,
+DGtal::Viewer3D::Image2DDomainD3D::updateDomainOrientation(ImageDirection normalDir,
double xBottomLeft, double yBottomLeft, double zBottomLeft)
{
if(normalDir==zDirection)
@@ -312,10 +312,10 @@ DGtal::Viewer3D< Space ,KSpace >::Image2DDomainD3D::updateDomainOrientation(Imag
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
inline
void
-DGtal::Viewer3D< Space ,KSpace >::Image2DDomainD3D::translateDomain (double xTranslation,
+DGtal::Viewer3D::Image2DDomainD3D::translateDomain (double xTranslation,
double yTranslation,
double zTranslation)
{
@@ -326,36 +326,36 @@ DGtal::Viewer3D< Space ,KSpace >::Image2DDomainD3D::translateDomain (double xTra
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
template < typename TDomain>
void
-DGtal::Viewer3D< Space ,KSpace >::addImage2DDomainD3D(const TDomain &aDomain,
+DGtal::Viewer3D::addImage2DDomainD3D(const TDomain &aDomain,
std::string mode,
const DGtal::Color &aColor)
{
- typename DGtal::Viewer3D< Space ,KSpace >::Image2DDomainD3D anImageDomain(aDomain);
+ typename DGtal::Viewer3D::Image2DDomainD3D anImageDomain(aDomain);
anImageDomain.color = aColor;
anImageDomain.myMode = mode;
- anImageDomain.myLineSetIndex=Viewer3D::myLineSetList.size();
+ anImageDomain.myLineSetIndex=Viewer3D::myLineSetList.size();
myImageDomainList.push_back(anImageDomain);
- Display3D< Space, KSpace>::updateBoundingBox(anImageDomain.point1);
- Display3D< Space, KSpace>::updateBoundingBox(anImageDomain.point2);
- Display3D< Space, KSpace>::updateBoundingBox(anImageDomain.point3);
- Display3D< Space, KSpace>::updateBoundingBox(anImageDomain.point4);
+ Display3D::updateBoundingBox(anImageDomain.point1);
+ Display3D::updateBoundingBox(anImageDomain.point2);
+ Display3D::updateBoundingBox(anImageDomain.point3);
+ Display3D::updateBoundingBox(anImageDomain.point4);
- std::vector::LineD3D> vectLines= compute2DDomainLineRepresentation(anImageDomain);
- Viewer3D::myLineSetList.push_back(vectLines);
+ std::vector::LineD3D> vectLines= compute2DDomainLineRepresentation(anImageDomain);
+ Viewer3D::myLineSetList.push_back(vectLines);
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
inline
-std::vector::LineD3D>
-DGtal::Viewer3D< Space ,KSpace >::compute2DDomainLineRepresentation( typename DGtal::Viewer3D< Space ,KSpace >::Image2DDomainD3D &anImageDomain )
+std::vector::LineD3D>
+DGtal::Viewer3D::compute2DDomainLineRepresentation( typename DGtal::Viewer3D::Image2DDomainD3D &anImageDomain )
{
- std::vector::LineD3D> vectLinesResu= compute2DDomainLineRepresentation(anImageDomain, 0.05);
- std::vector::LineD3D> vectLinesVerso= compute2DDomainLineRepresentation(anImageDomain, -0.05);
+ std::vector::LineD3D> vectLinesResu= compute2DDomainLineRepresentation(anImageDomain, 0.05);
+ std::vector::LineD3D> vectLinesVerso= compute2DDomainLineRepresentation(anImageDomain, -0.05);
for(unsigned int i=0; i::compute2DDomainLineRepresentation( typename DG
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
inline
-std::vector::LineD3D>
-DGtal::Viewer3D< Space ,KSpace >::compute2DDomainLineRepresentation(typename DGtal::Viewer3D< Space ,KSpace >::Image2DDomainD3D &anImageDomain, double delta )
+std::vector::LineD3D>
+DGtal::Viewer3D::compute2DDomainLineRepresentation(typename DGtal::Viewer3D::Image2DDomainD3D &anImageDomain, double delta )
{
- std::vector::LineD3D> aLineSet;
- typename Viewer3D::LineD3D aLine;
+ std::vector::LineD3D> aLineSet;
+ typename Viewer3D::LineD3D aLine;
aLine.color = anImageDomain.color;
aLine.width=0.1;
@@ -499,24 +499,24 @@ DGtal::Viewer3D< Space ,KSpace >::compute2DDomainLineRepresentation(typename DGt
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
inline
void
-DGtal::Viewer3D< Space ,KSpace >::updateAn2DDomainOrientation(unsigned int domainIndex,
+DGtal::Viewer3D::updateAn2DDomainOrientation(unsigned int domainIndex,
double xPosition, double yPosition,
double zPosition, ImageDirection newDirection)
{
ASSERT( domainIndex < myImageDomainList.size());
- typename Viewer3D< Space ,KSpace >::Image2DDomainD3D &aDomain = myImageDomainList.at(domainIndex);
+ typename Viewer3D::Image2DDomainD3D &aDomain = myImageDomainList.at(domainIndex);
- Display3D< Space, KSpace>::updateBoundingBox(aDomain.point1);
- Display3D< Space, KSpace>::updateBoundingBox(aDomain.point2);
- Display3D< Space, KSpace>::updateBoundingBox(aDomain.point3);
- Display3D< Space, KSpace>::updateBoundingBox(aDomain.point4);
+ Display3D::updateBoundingBox(aDomain.point1);
+ Display3D::updateBoundingBox(aDomain.point2);
+ Display3D::updateBoundingBox(aDomain.point3);
+ Display3D::updateBoundingBox(aDomain.point4);
aDomain.updateDomainOrientation(newDirection, xPosition, yPosition, zPosition);
- std::vector::LineD3D> vectNewLines= compute2DDomainLineRepresentation(aDomain);
- std::vector::LineD3D> &vectLines = Viewer3D::myLineSetList.at(aDomain.myLineSetIndex);
+ std::vector::LineD3D> vectNewLines= compute2DDomainLineRepresentation(aDomain);
+ std::vector::LineD3D> &vectLines = Viewer3D::myLineSetList.at(aDomain.myLineSetIndex);
vectLines.clear();
for(unsigned int i=0; i::updateAn2DDomainOrientation(unsigned int domai
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
inline
void
-DGtal::Viewer3D< Space ,KSpace >::translateAn2DDomain(unsigned int domainIndex, double xTranslation, double yTranslation, double zTranslation)
+DGtal::Viewer3D::translateAn2DDomain(unsigned int domainIndex, double xTranslation, double yTranslation, double zTranslation)
{
- typename Viewer3D< Space ,KSpace >::Image2DDomainD3D &anDomain = myImageDomainList.at(domainIndex);
+ typename Viewer3D::Image2DDomainD3D &anDomain = myImageDomainList.at(domainIndex);
anDomain.translateDomain(xTranslation, yTranslation, zTranslation);
- Display3D< Space, KSpace>::updateBoundingBox(anDomain.point1);
- Display3D< Space, KSpace>::updateBoundingBox(anDomain.point2);
- Display3D< Space, KSpace>::updateBoundingBox(anDomain.point3);
- Display3D< Space, KSpace>::updateBoundingBox(anDomain.point4);
+ Display3D::updateBoundingBox(anDomain.point1);
+ Display3D::updateBoundingBox(anDomain.point2);
+ Display3D::updateBoundingBox(anDomain.point3);
+ Display3D::updateBoundingBox(anDomain.point4);
- std::vector::LineD3D> &vectLines = Viewer3D::myLineSetList.at(anDomain.myLineSetIndex);
+ std::vector::LineD3D> &vectLines = Viewer3D::myLineSetList.at(anDomain.myLineSetIndex);
for(unsigned int i=0; i::LineD3D &aLine = vectLines.at(i);
+ typename DGtal::Display3D::LineD3D &aLine = vectLines.at(i);
aLine.point1[0]=aLine.point1[0]+xTranslation; aLine.point1[1]=aLine.point1[1]+yTranslation; aLine.point1[2]=aLine.point1[2]+zTranslation;
aLine.point2[0]=aLine.point2[0]+xTranslation; aLine.point2[1]=aLine.point2[1]+yTranslation; aLine.point2[2]=aLine.point2[2]+zTranslation;
}
}
-template < typename Space ,typename KSpace >
+template < typename TSpace, typename TKSpace >
inline
std::string
-DGtal::Viewer3D< Space ,KSpace >::TextureImage::className() const
+DGtal::Viewer3D::TextureImage::className() const
{
return "TextureImage";
}
-template
+template
inline
-DGtal::Viewer3D &
-DGtal::Viewer3D::operator<<(const DGtal::Color & aColor)
+DGtal::Viewer3D &
+DGtal::Viewer3D::operator<<(const DGtal::Color & aColor)
{
myDefaultColor=aColor;
return *this;
}
-template
+template
inline
-DGtal::Viewer3D &
-DGtal::Viewer3D::operator<<(const typename Viewer3D::StreamKey & key)
+DGtal::Viewer3D &
+DGtal::Viewer3D::operator<<(const typename Viewer3D::StreamKey & key)
{
switch (key)
{
- case Viewer3D::updateDisplay:
- Viewer3D::updateList();
+ case Viewer3D::updateDisplay:
+ Viewer3D::updateList();
break;
- case Viewer3D::addNewList:
- Viewer3D::createNewCubeList();
+ case Viewer3D::addNewList:
+ Viewer3D::createNewCubeList();
break;
- case Viewer3D::shiftSurfelVisu:
- Viewer3D::myCurrentfShiftVisuPrisms+=0.3;
+ case Viewer3D::shiftSurfelVisu:
+ Viewer3D::myCurrentfShiftVisuPrisms+=0.3;
break;
}
return *this;
}
-template
+template
template
inline
-DGtal::Viewer3D &
-DGtal::Viewer3D::operator<<( const TDrawableWithViewer3D & object )
+DGtal::Viewer3D &
+DGtal::Viewer3D::operator<<( const TDrawableWithViewer3D & object )
{
BOOST_CONCEPT_ASSERT((concepts::CDrawableWithViewer3D< TDrawableWithViewer3D, Space, KSpace >));
- DGtal::Viewer3DFactory::draw(*this, object);
+ DGtal::Viewer3DFactory::draw(*this, object);
return *this;
}
@@ -602,11 +602,11 @@ DGtal::Viewer3D::operator<<( const TDrawableWithViewer3D & object
///////////////////////////////////////////////////////////////////////////////
// Implementation of inline functions and external operators //
-template
+template
inline
std::ostream&
DGtal::operator<< ( std::ostream & out,
- const Viewer3D & object )
+ const Viewer3D & object )
{
object.selfDisplay ( out );
return out;
@@ -632,40 +632,41 @@ DGtal::operator<< ( std::ostream & out,
// end of surcharge //
///////////////////////////////////////////////////////////////////////////////
-template< typename Space, typename KSpace>
+template< typename TSpace, typename TKSpace>
inline
void
-DGtal::Viewer3D::drawWithNames()
+DGtal::Viewer3D::drawWithNames()
{
// JOL: 2014/10/15. This method is called only when the user tries
// to select some graphic object through QGLViewer. By default,
// selection is left clic + shift key.
// JOL: 2014/10/15. This is my addition for interacting with
// quads. Seems to work well.
+ if ( myExtension != 0 ) myExtension->drawWithNames( *this );
glCallList ( myQuadsMapId );
glCallList ( myCubesMapId );
- for ( unsigned int i=0; i::myLineSetList.size(); i++ )
+ for ( unsigned int i=0; i::myLineSetList.size(); i++ )
{
glCallList ( myLineSetListId+i );
}
- for ( unsigned int i=0; i::myBallSetList.size(); i++ )
+ for ( unsigned int i=0; i::myBallSetList.size(); i++ )
{
glCallList(myBallSetListId+i);
}
}
-template< typename Space, typename KSpace>
+template< typename TSpace, typename TKSpace>
inline
void
-DGtal::Viewer3D::draw()
+DGtal::Viewer3D::draw()
{
-
+ if ( myExtension != 0 ) myExtension->draw( *this );
glPushMatrix();
glMultMatrixd ( manipulatedFrame()->matrix() );
@@ -683,10 +684,10 @@ DGtal::Viewer3D::draw()
glLightfv(GL_LIGHT0, GL_POSITION, myLightPosition);
unsigned int i = 0;
- typename vector< typename Viewer3D::ClippingPlaneD3D >::const_iterator it = Viewer3D::myClippingPlaneList.begin();
+ typename vector< typename Viewer3D::ClippingPlaneD3D >::const_iterator it = Viewer3D::myClippingPlaneList.begin();
// OpenGL can't draw more than GL_MAX_CLIP_PLANES clipping plane
- while ( i < GL_MAX_CLIP_PLANES && it !=Viewer3D::myClippingPlaneList.end() )
+ while ( i < GL_MAX_CLIP_PLANES && it !=Viewer3D::myClippingPlaneList.end() )
{
double eq [4];
eq[0]=it->a;
@@ -733,12 +734,12 @@ DGtal::Viewer3D::draw()
}
- for ( unsigned int j=0; j< Viewer3D::myLineSetList.size(); j++ )
+ for ( unsigned int j=0; j< Viewer3D::myLineSetList.size(); j++ )
{
- if ( Viewer3D::myLineSetList.at ( j ).size() !=0 )
+ if ( Viewer3D::myLineSetList.at ( j ).size() !=0 )
{
glLineWidth ( max(myGLLineMinWidth,
- Viewer3D::myLineSetList.at ( j ).at ( 0 ).width )) ;
+ Viewer3D::myLineSetList.at ( j ).at ( 0 ).width )) ;
}
glCallList(myLineSetListId+j);
}
@@ -748,14 +749,14 @@ DGtal::Viewer3D::draw()
glCallList( myCubesMapId );
- for ( unsigned int j=0; j< Viewer3D::myBallSetList.size(); j++ )
+ for ( unsigned int j=0; j< Viewer3D::myBallSetList.size(); j++ )
{
if(myUseGLPointsForBalls)
{
- if ( Viewer3D::myBallSetList.at ( j ).size() !=0 )
+ if ( Viewer3D::myBallSetList.at ( j ).size() !=0 )
{
glPointSize ( max(myGLPointMinWidth,
- ( Viewer3D::myBallSetList.at ( j ).at ( 0 ).radius ) ));
+ ( Viewer3D::myBallSetList.at ( j ).at ( 0 ).radius ) ));
}
}
else
@@ -769,7 +770,7 @@ DGtal::Viewer3D::draw()
glCallList(myQuadsMapId);
if(myViewWire)
{
- glLineWidth ( max(myGLLineMinWidth,Viewer3D::myMeshDefaultLineWidth /distCam ));
+ glLineWidth ( max(myGLLineMinWidth,Viewer3D::myMeshDefaultLineWidth /distCam ));
glCallList(myQuadsMapWiredId);
}
@@ -778,7 +779,7 @@ DGtal::Viewer3D::draw()
if(myViewWire)
{
glLineWidth ( max(myGLLineMinWidth,
- Viewer3D::myMeshDefaultLineWidth /distCam ));
+ Viewer3D::myMeshDefaultLineWidth /distCam ));
glCallList(myTriangleSetListWiredId);
}
@@ -787,7 +788,7 @@ DGtal::Viewer3D::draw()
if(myViewWire)
{
glLineWidth (max(myGLLineMinWidth,
- Viewer3D::myMeshDefaultLineWidth /distCam ));
+ Viewer3D::myMeshDefaultLineWidth /distCam ));
glCallList(myPolygonSetListWiredId);
}
@@ -800,25 +801,26 @@ DGtal::Viewer3D::draw()
}
-template< typename Space, typename KSpace>
+template< typename TSpace, typename TKSpace>
void
-DGtal::Viewer3D::selfDisplay ( std::ostream & out ) const
+DGtal::Viewer3D::selfDisplay ( std::ostream & out ) const
{
out << "[Viewer3D]";
}
-template< typename Space, typename KSpace>
+template< typename TSpace, typename TKSpace>
bool
-DGtal::Viewer3D::isValid() const
+DGtal::Viewer3D::isValid() const
{
return true;
}
-template< typename Space, typename KSpace>
+template< typename TSpace, typename TKSpace>
void
-DGtal::Viewer3D::init()
+DGtal::Viewer3D::init()
{
+ if ( myExtension != 0 ) myExtension->init( *this );
myAutoSaveState = false;
myIsMovingLight = false;
myLigthRotationStep = 0.01;
@@ -847,34 +849,34 @@ DGtal::Viewer3D::init()
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
- Viewer3D::myMeshDefaultLineWidth=10.0;
+ Viewer3D::myMeshDefaultLineWidth=10.0;
myNbListe=0;
myViewWire=false;
setBackgroundColor ( QColor ( 217, 228, 255 ) );
setForegroundColor ( QColor ( 217, 22, 25 ) );
- Viewer3D::createNewCubeList ( );
- vector::LineD3D> listeLine;
- Viewer3D::myLineSetList.push_back ( listeLine );
- vector::BallD3D> listeBall;
- Viewer3D::myBallSetList.push_back ( listeBall );
- Viewer3D::myCurrentFillColor = Color ( 220, 220, 220 );
- Viewer3D::myCurrentLineColor = Color ( 22, 22, 222, 50 );
+ Viewer3D::createNewCubeList ( );
+ vector::LineD3D> listeLine;
+ Viewer3D::myLineSetList.push_back ( listeLine );
+ vector::BallD3D> listeBall;
+ Viewer3D::myBallSetList.push_back ( listeBall );
+ Viewer3D::myCurrentFillColor = Color ( 220, 220, 220 );
+ Viewer3D::myCurrentLineColor = Color ( 22, 22, 222, 50 );
myDefaultBackgroundColor = Color ( backgroundColor().red(), backgroundColor().green(),
backgroundColor().blue() );
myIsBackgroundDefault=true;
- Viewer3D::myBoundingPtLow[0]=-10.0;//numeric_limits::max( );
- Viewer3D::myBoundingPtLow[1]=-10.0;//numeric_limits::max( );
- Viewer3D::myBoundingPtLow[2]=-10.0;//numeric_limits::max( );
-
- Viewer3D::myBoundingPtUp[0]=-10.0;//numeric_limits::min( );
- Viewer3D::myBoundingPtUp[1]=-10.0;//numeric_limits::min( );
- Viewer3D:: myBoundingPtUp[2]=-10.0;//numeric_limits::min( );
- Viewer3D::createNewCubeList ( );
- typename std::vector< typename Viewer3D::CubeD3D> aKSCubeList;
-
- Viewer3D::myCurrentfShiftVisuPrisms=0.0;
- Viewer3D::myDefaultColor= Color ( 255, 255, 255 );
+ Viewer3D::myBoundingPtLow[0]=-10.0;//numeric_limits::max( );
+ Viewer3D::myBoundingPtLow[1]=-10.0;//numeric_limits::max( );
+ Viewer3D::myBoundingPtLow[2]=-10.0;//numeric_limits::max( );
+
+ Viewer3D::myBoundingPtUp[0]=-10.0;//numeric_limits::min( );
+ Viewer3D::myBoundingPtUp[1]=-10.0;//numeric_limits::min( );
+ Viewer3D:: myBoundingPtUp[2]=-10.0;//numeric_limits::min( );
+ Viewer3D::createNewCubeList ( );
+ typename std::vector< typename Viewer3D::CubeD3D> aKSCubeList;
+
+ Viewer3D::myCurrentfShiftVisuPrisms=0.0;
+ Viewer3D