Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenMesh
OpenMesh
Commits
56f447c3
Commit
56f447c3
authored
Feb 17, 2009
by
Jan Möbius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Readded Unsupported to trunk
git-svn-id:
http://www.openmesh.org/svnrepo/OpenMesh/trunk@78
fdac6126-5c0c-442c-9429-916003d36597
parent
aec65489
Changes
66
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
66 changed files
with
13726 additions
and
0 deletions
+13726
-0
Apps/Unsupported/IvViewer/ACGMakefile
Apps/Unsupported/IvViewer/ACGMakefile
+37
-0
Apps/Unsupported/IvViewer/SoOpenMeshNodeT.cc
Apps/Unsupported/IvViewer/SoOpenMeshNodeT.cc
+370
-0
Apps/Unsupported/IvViewer/SoOpenMeshNodeT.hh
Apps/Unsupported/IvViewer/SoOpenMeshNodeT.hh
+117
-0
Apps/Unsupported/IvViewer/SoOpenMeshSupport.hh
Apps/Unsupported/IvViewer/SoOpenMeshSupport.hh
+111
-0
Apps/Unsupported/IvViewer/ivviewer.cc
Apps/Unsupported/IvViewer/ivviewer.cc
+140
-0
Apps/Unsupported/OsgViewer/ACGMakefile
Apps/Unsupported/OsgViewer/ACGMakefile
+21
-0
Apps/Unsupported/OsgViewer/README
Apps/Unsupported/OsgViewer/README
+11
-0
Apps/Unsupported/OsgViewer/meshviewer.cc
Apps/Unsupported/OsgViewer/meshviewer.cc
+134
-0
Apps/Unsupported/OsgViewer/osgviewer.cc
Apps/Unsupported/OsgViewer/osgviewer.cc
+481
-0
Apps/Unsupported/ProgViewer/ACGMakefile
Apps/Unsupported/ProgViewer/ACGMakefile
+18
-0
Apps/Unsupported/ProgViewer/OpenMesh_Apps_ProgViewer.vcproj
Apps/Unsupported/ProgViewer/OpenMesh_Apps_ProgViewer.vcproj
+274
-0
Apps/Unsupported/ProgViewer/ProgViewerWidget.cc
Apps/Unsupported/ProgViewer/ProgViewerWidget.cc
+321
-0
Apps/Unsupported/ProgViewer/ProgViewerWidget.hh
Apps/Unsupported/ProgViewer/ProgViewerWidget.hh
+137
-0
Apps/Unsupported/ProgViewer/progviewer.cc
Apps/Unsupported/ProgViewer/progviewer.cc
+78
-0
Apps/Unsupported/Streaming-qt4/ACGMakefile
Apps/Unsupported/Streaming-qt4/ACGMakefile
+16
-0
Apps/Unsupported/Streaming-qt4/Client/ACGMakefile
Apps/Unsupported/Streaming-qt4/Client/ACGMakefile
+19
-0
Apps/Unsupported/Streaming-qt4/Client/MeshViewerWidgetT.cc
Apps/Unsupported/Streaming-qt4/Client/MeshViewerWidgetT.cc
+603
-0
Apps/Unsupported/Streaming-qt4/Client/MeshViewerWidgetT.hh
Apps/Unsupported/Streaming-qt4/Client/MeshViewerWidgetT.hh
+163
-0
Apps/Unsupported/Streaming-qt4/Client/MyMesh.hh
Apps/Unsupported/Streaming-qt4/Client/MyMesh.hh
+23
-0
Apps/Unsupported/Streaming-qt4/Client/QGLViewerWidget.cc
Apps/Unsupported/Streaming-qt4/Client/QGLViewerWidget.cc
+621
-0
Apps/Unsupported/Streaming-qt4/Client/QGLViewerWidget.hh
Apps/Unsupported/Streaming-qt4/Client/QGLViewerWidget.hh
+164
-0
Apps/Unsupported/Streaming-qt4/Client/VDPMClientViewerWidget.cc
...nsupported/Streaming-qt4/Client/VDPMClientViewerWidget.cc
+1351
-0
Apps/Unsupported/Streaming-qt4/Client/VDPMClientViewerWidget.hh
...nsupported/Streaming-qt4/Client/VDPMClientViewerWidget.hh
+320
-0
Apps/Unsupported/Streaming-qt4/Client/VDPMStreamingClient.cc
Apps/Unsupported/Streaming-qt4/Client/VDPMStreamingClient.cc
+72
-0
Apps/Unsupported/Streaming-qt4/Client/camera.cmr
Apps/Unsupported/Streaming-qt4/Client/camera.cmr
+4
-0
Apps/Unsupported/Streaming-qt4/Server/ACGMakefile
Apps/Unsupported/Streaming-qt4/Server/ACGMakefile
+18
-0
Apps/Unsupported/Streaming-qt4/Server/ServerSideVDPM.cc
Apps/Unsupported/Streaming-qt4/Server/ServerSideVDPM.cc
+225
-0
Apps/Unsupported/Streaming-qt4/Server/ServerSideVDPM.hh
Apps/Unsupported/Streaming-qt4/Server/ServerSideVDPM.hh
+88
-0
Apps/Unsupported/Streaming-qt4/Server/VDPMServerSession.cc
Apps/Unsupported/Streaming-qt4/Server/VDPMServerSession.cc
+475
-0
Apps/Unsupported/Streaming-qt4/Server/VDPMServerSession.hh
Apps/Unsupported/Streaming-qt4/Server/VDPMServerSession.hh
+148
-0
Apps/Unsupported/Streaming-qt4/Server/VDPMServerSocket.hh
Apps/Unsupported/Streaming-qt4/Server/VDPMServerSocket.hh
+51
-0
Apps/Unsupported/Streaming-qt4/Server/VDPMServerViewerWidget.cc
...nsupported/Streaming-qt4/Server/VDPMServerViewerWidget.cc
+81
-0
Apps/Unsupported/Streaming-qt4/Server/VDPMServerViewerWidget.hh
...nsupported/Streaming-qt4/Server/VDPMServerViewerWidget.hh
+72
-0
Apps/Unsupported/Streaming-qt4/Server/VDPMStreamingServer.cc
Apps/Unsupported/Streaming-qt4/Server/VDPMStreamingServer.cc
+34
-0
Apps/Unsupported/Streaming-qt4/Server/VDPMStreamingServer.hh
Apps/Unsupported/Streaming-qt4/Server/VDPMStreamingServer.hh
+6
-0
Apps/Unsupported/Streaming-qt4/Server/bunny.pm
Apps/Unsupported/Streaming-qt4/Server/bunny.pm
+0
-0
Apps/Unsupported/Streaming-qt4/Server/bunny.spm
Apps/Unsupported/Streaming-qt4/Server/bunny.spm
+0
-0
Apps/Unsupported/Streaming-qt4/Server/rockerArm.pm
Apps/Unsupported/Streaming-qt4/Server/rockerArm.pm
+0
-0
Apps/Unsupported/Streaming/ACGMakefile
Apps/Unsupported/Streaming/ACGMakefile
+16
-0
Apps/Unsupported/Streaming/Client/ACGMakefile
Apps/Unsupported/Streaming/Client/ACGMakefile
+19
-0
Apps/Unsupported/Streaming/Client/MeshViewerWidgetT.cc
Apps/Unsupported/Streaming/Client/MeshViewerWidgetT.cc
+602
-0
Apps/Unsupported/Streaming/Client/MeshViewerWidgetT.hh
Apps/Unsupported/Streaming/Client/MeshViewerWidgetT.hh
+163
-0
Apps/Unsupported/Streaming/Client/MyMesh.hh
Apps/Unsupported/Streaming/Client/MyMesh.hh
+23
-0
Apps/Unsupported/Streaming/Client/QGLViewerWidget.cc
Apps/Unsupported/Streaming/Client/QGLViewerWidget.cc
+621
-0
Apps/Unsupported/Streaming/Client/QGLViewerWidget.hh
Apps/Unsupported/Streaming/Client/QGLViewerWidget.hh
+163
-0
Apps/Unsupported/Streaming/Client/VDPMClientViewerWidget.cc
Apps/Unsupported/Streaming/Client/VDPMClientViewerWidget.cc
+1340
-0
Apps/Unsupported/Streaming/Client/VDPMClientViewerWidget.hh
Apps/Unsupported/Streaming/Client/VDPMClientViewerWidget.hh
+320
-0
Apps/Unsupported/Streaming/Client/VDPMStreamingClient.cc
Apps/Unsupported/Streaming/Client/VDPMStreamingClient.cc
+73
-0
Apps/Unsupported/Streaming/Server/ACGMakefile
Apps/Unsupported/Streaming/Server/ACGMakefile
+18
-0
Apps/Unsupported/Streaming/Server/ServerSideVDPM.cc
Apps/Unsupported/Streaming/Server/ServerSideVDPM.cc
+225
-0
Apps/Unsupported/Streaming/Server/ServerSideVDPM.hh
Apps/Unsupported/Streaming/Server/ServerSideVDPM.hh
+87
-0
Apps/Unsupported/Streaming/Server/VDPMServerSession.cc
Apps/Unsupported/Streaming/Server/VDPMServerSession.cc
+467
-0
Apps/Unsupported/Streaming/Server/VDPMServerSession.hh
Apps/Unsupported/Streaming/Server/VDPMServerSession.hh
+146
-0
Apps/Unsupported/Streaming/Server/VDPMServerSocket.hh
Apps/Unsupported/Streaming/Server/VDPMServerSocket.hh
+47
-0
Apps/Unsupported/Streaming/Server/VDPMServerViewerWidget.cc
Apps/Unsupported/Streaming/Server/VDPMServerViewerWidget.cc
+80
-0
Apps/Unsupported/Streaming/Server/VDPMServerViewerWidget.hh
Apps/Unsupported/Streaming/Server/VDPMServerViewerWidget.hh
+70
-0
Apps/Unsupported/Streaming/Server/VDPMStreamingServer.cc
Apps/Unsupported/Streaming/Server/VDPMStreamingServer.cc
+34
-0
Apps/Unsupported/Streaming/Server/VDPMStreamingServer.hh
Apps/Unsupported/Streaming/Server/VDPMStreamingServer.hh
+6
-0
Apps/Unsupported/VDProgMesh/Analyzer/Analyzer.pro
Apps/Unsupported/VDProgMesh/Analyzer/Analyzer.pro
+30
-0
Apps/Unsupported/VDProgMesh/Analyzer/vdpmanalyzer.cc
Apps/Unsupported/VDProgMesh/Analyzer/vdpmanalyzer.cc
+1161
-0
Apps/Unsupported/VDProgMesh/Synthesizer/Synthesizer.pro
Apps/Unsupported/VDProgMesh/Synthesizer/Synthesizer.pro
+31
-0
Apps/Unsupported/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc
...ted/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.cc
+596
-0
Apps/Unsupported/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.hh
...ted/VDProgMesh/Synthesizer/VDPMSynthesizerViewerWidget.hh
+181
-0
Apps/Unsupported/VDProgMesh/Synthesizer/vdpmsynthesizer.cc
Apps/Unsupported/VDProgMesh/Synthesizer/vdpmsynthesizer.cc
+53
-0
Apps/Unsupported/VDProgMesh/mkbalancedpm/mkbalancedpm.cc
Apps/Unsupported/VDProgMesh/mkbalancedpm/mkbalancedpm.cc
+320
-0
Apps/Unsupported/VDProgMesh/mkbalancedpm/mkbalancedpm.pro
Apps/Unsupported/VDProgMesh/mkbalancedpm/mkbalancedpm.pro
+30
-0
No files found.
Apps/Unsupported/IvViewer/ACGMakefile
0 → 100644
View file @
56f447c3
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
SUBDIRS := $(call find-subdirs)
USE_COIN := no
USE_SOQT := no
ifeq ($(USE_COIN),yes)
USE_SOQT := yes
endif
ifeq ($(USE_SOQT),yes)
CXX_DEFS += -DUSE_SOQT=1
ifeq ($(USE_COIN),yes)
PACKAGES := coin soqt_coin glut opengl qt
else
PACKAGES := Inventor soqt_inventor glut opengl qt
endif
else
PACKAGES := inventor opengl x11
endif
PROJ_LIBS = OpenMesh/Core
MODULES := cxx
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
Apps/Unsupported/IvViewer/SoOpenMeshNodeT.cc
0 → 100644
View file @
56f447c3
//=============================================================================
//
// OpenMesh
// Copyright (C) 2003 by Computer Graphics Group, RWTH Aachen
// www.openmesh.org
//
//-----------------------------------------------------------------------------
//
// License
//
// This library 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, version 2.1.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//-----------------------------------------------------------------------------
//
// $Revision: 1800 $
// $Date: 2008-05-19 11:51:23 +0200 (Mo, 19. Mai 2008) $
//
//=============================================================================
//=============================================================================
//
// Class SoOpenMeshNodeT - implementation
//
//=============================================================================
#define OPENMESH_SOOPENMESHNODE_CC
//== INCLUDES =================================================================
#include <GL/gl.h>
#include <Inventor/SbBox.h>
#include <Inventor/SoPrimitiveVertex.h>
#include <Inventor/actions/SoGLRenderAction.h>
#include <Inventor/misc/SoState.h>
#include <Inventor/elements/SoLightModelElement.h>
#include <Inventor/bundles/SoMaterialBundle.h>
#include "SoOpenMeshNodeT.hh"
// Attention must be included after SoOpenMeshNodeT.hh
// as it redefines several macros!
#include "SoOpenMeshSupport.hh"
#include <OpenMesh/Core/Math/VectorT.hh>
//== NAMESPACES ==============================================================
namespace
OpenMesh
{
//== IMPLEMENTATION ==========================================================
// Helper functions: draw vertices
inline
void
glVertex
(
const
OpenMesh
::
Vec3f
&
_v
)
{
glVertex3fv
(
_v
);
}
inline
void
glVertex
(
const
OpenMesh
::
Vec3d
&
_v
)
{
glVertex3dv
(
_v
);
}
// Helper functions: draw normal
inline
void
glNormal
(
const
OpenMesh
::
Vec3f
&
_n
)
{
glNormal3fv
(
_n
);
}
inline
void
glNormal
(
const
OpenMesh
::
Vec3d
&
_n
)
{
glNormal3dv
(
_n
);
}
// Helper function: convert Vec to SbVec3f
template
<
class
Vec
>
inline
SbVec3f
sbvec3f
(
const
Vec
&
_v
)
{
return
SbVec3f
(
_v
[
0
],
_v
[
1
],
_v
[
2
]);
}
//-----------------------------------------------------------------------------
template
<
class
Mesh
>
void
SoOpenMeshNodeT
<
Mesh
>::
initClass
()
{
SO_NODE_INIT_CLASS
(
SoOpenMeshNodeT
<
Mesh
>
,
SoShape
,
"Shape"
);
}
//-----------------------------------------------------------------------------
template
<
class
Mesh
>
SoOpenMeshNodeT
<
Mesh
>::
SoOpenMeshNodeT
(
const
Mesh
*
_mesh
)
:
mesh_
(
_mesh
)
{
SO_NODE_CONSTRUCTOR
(
SoOpenMeshNodeT
<
Mesh
>
);
}
//-----------------------------------------------------------------------------
template
<
class
Mesh
>
void
SoOpenMeshNodeT
<
Mesh
>::
GLRender
(
SoGLRenderAction
*
action
)
{
if
(
mesh_
&&
shouldGLRender
(
action
))
{
SoState
*
state
=
action
->
getState
();
SbBool
send_normals
=
(
SoLightModelElement
::
get
(
state
)
!=
SoLightModelElement
::
BASE_COLOR
);
SoMaterialBundle
mb
(
action
);
mb
.
sendFirst
();
drawFaces
(
send_normals
);
}
}
//----------------------------------------------------------------------------
template
<
class
Mesh
>
void
SoOpenMeshNodeT
<
Mesh
>::
drawFaces
(
bool
_send_normals
,
OpenMesh
::
GenProg
::
Bool2Type
<
true
>
)
{
typename
Mesh
::
ConstFaceIter
f_it
(
mesh_
->
faces_begin
()),
f_end
(
mesh_
->
faces_end
());
typename
Mesh
::
ConstFaceVertexIter
fv_it
;
if
(
_send_normals
)
{
glBegin
(
GL_TRIANGLES
);
for
(;
f_it
!=
f_end
;
++
f_it
)
{
glNormal
(
mesh_
->
normal
(
f_it
));
fv_it
=
mesh_
->
cfv_iter
(
f_it
.
handle
());
glVertex
(
mesh_
->
point
(
fv_it
));
++
fv_it
;
glVertex
(
mesh_
->
point
(
fv_it
));
++
fv_it
;
glVertex
(
mesh_
->
point
(
fv_it
));
}
glEnd
();
}
else
{
glBegin
(
GL_TRIANGLES
);
for
(;
f_it
!=
f_end
;
++
f_it
)
{
fv_it
=
mesh_
->
cfv_iter
(
f_it
.
handle
());
glVertex
(
mesh_
->
point
(
fv_it
));
++
fv_it
;
glVertex
(
mesh_
->
point
(
fv_it
));
++
fv_it
;
glVertex
(
mesh_
->
point
(
fv_it
));
}
glEnd
();
}
}
//----------------------------------------------------------------------------
template
<
class
Mesh
>
void
SoOpenMeshNodeT
<
Mesh
>::
drawFaces
(
bool
_send_normals
,
OpenMesh
::
GenProg
::
Bool2Type
<
false
>
)
{
typename
Mesh
::
ConstFaceIter
f_it
(
mesh_
->
faces_begin
()),
f_end
(
mesh_
->
faces_end
());
typename
Mesh
::
ConstFaceVertexIter
fv_it
;
if
(
_send_normals
)
{
for
(;
f_it
!=
f_end
;
++
f_it
)
{
glBegin
(
GL_POLYGON
);
glNormal
(
mesh_
->
normal
(
f_it
));
for
(
fv_it
=
mesh_
->
cfv_iter
(
f_it
.
handle
());
fv_it
;
++
fv_it
)
glVertex
(
mesh_
->
point
(
fv_it
));
glEnd
();
}
}
else
{
for
(;
f_it
!=
f_end
;
++
f_it
)
{
glBegin
(
GL_POLYGON
);
for
(
fv_it
=
mesh_
->
cfv_iter
(
f_it
.
handle
());
fv_it
;
++
fv_it
)
glVertex
(
mesh_
->
point
(
fv_it
));
glEnd
();
}
}
}
//-----------------------------------------------------------------------------
template
<
class
Mesh
>
void
SoOpenMeshNodeT
<
Mesh
>::
generatePrimitives
(
SoAction
*
_action
)
{
if
(
mesh_
)
genPrimitives
(
_action
);
}
//----------------------------------------------------------------------------
template
<
class
Mesh
>
void
SoOpenMeshNodeT
<
Mesh
>::
genPrimitives
(
SoAction
*
_action
,
OpenMesh
::
GenProg
::
Bool2Type
<
true
>
)
{
typename
Mesh
::
ConstFaceIter
f_it
(
mesh_
->
faces_begin
()),
f_end
(
mesh_
->
faces_end
());
typename
Mesh
::
ConstFaceVertexIter
fv_it
;
SoPrimitiveVertex
pv
;
beginShape
(
_action
,
TRIANGLES
);
for
(;
f_it
!=
f_end
;
++
f_it
)
{
pv
.
setNormal
(
sbvec3f
(
mesh_
->
normal
(
f_it
)));
fv_it
=
mesh_
->
cfv_iter
(
f_it
.
handle
());
pv
.
setPoint
(
sbvec3f
(
mesh_
->
point
(
fv_it
)));
shapeVertex
(
&
pv
);
++
fv_it
;
pv
.
setPoint
(
sbvec3f
(
mesh_
->
point
(
fv_it
)));
shapeVertex
(
&
pv
);
++
fv_it
;
pv
.
setPoint
(
sbvec3f
(
mesh_
->
point
(
fv_it
)));
shapeVertex
(
&
pv
);
}
endShape
();
}
//----------------------------------------------------------------------------
template
<
class
Mesh
>
void
SoOpenMeshNodeT
<
Mesh
>::
genPrimitives
(
SoAction
*
_action
,
OpenMesh
::
GenProg
::
Bool2Type
<
false
>
)
{
typename
Mesh
::
ConstFaceIter
f_it
(
mesh_
->
faces_begin
()),
f_end
(
mesh_
->
faces_end
());
typename
Mesh
::
ConstFaceVertexIter
fv_it
;
SoPrimitiveVertex
pv
;
for
(;
f_it
!=
f_end
;
++
f_it
)
{
beginShape
(
_action
,
POLYGON
);
pv
.
setNormal
(
sbvec3f
(
mesh_
->
normal
(
f_it
)));
for
(
fv_it
=
mesh_
->
cfv_iter
(
f_it
.
handle
());
fv_it
;
++
fv_it
)
{
pv
.
setPoint
(
sbvec3f
(
mesh_
->
point
(
fv_it
)));
shapeVertex
(
&
pv
);
}
endShape
();
}
}
//-----------------------------------------------------------------------------
template
<
class
Mesh
>
void
SoOpenMeshNodeT
<
Mesh
>::
computeBBox
(
SoAction
*
action
,
SbBox3f
&
box
,
SbVec3f
&
center
)
{
if
(
mesh_
&&
mesh_
->
n_vertices
())
{
typename
Mesh
::
ConstVertexIter
vIt
(
mesh_
->
vertices_begin
());
typename
Mesh
::
ConstVertexIter
vEnd
(
mesh_
->
vertices_end
());
typename
Mesh
::
Point
min
(
mesh_
->
point
(
vIt
));
typename
Mesh
::
Point
max
(
mesh_
->
point
(
vIt
));
for
(
++
vIt
;
vIt
!=
vEnd
;
++
vIt
)
{
max
.
maximize
(
mesh_
->
point
(
vIt
));
min
.
minimize
(
mesh_
->
point
(
vIt
));
}
box
.
setBounds
(
SbVec3f
(
min
[
0
],
min
[
1
],
min
[
2
]),
SbVec3f
(
max
[
0
],
max
[
1
],
max
[
2
]));
}
else
box
.
setBounds
(
SbVec3f
(
0
,
0
,
0
),
SbVec3f
(
0
,
0
,
0
));
}
//-----------------------------------------------------------------------------
#if 0
/* As we are using templates, we cannot use the predefined macro
SO_NODE_SOURCE to automatically generate the following piece of
code. Ugly, but necessary.
*/
template <class Mesh>
SoType SoOpenMeshNodeT<Mesh>::classTypeId;
template <class Mesh>
SoFieldData *SoOpenMeshNodeT<Mesh>::fieldData;
template <class Mesh>
const SoFieldData **SoOpenMeshNodeT<Mesh>::parentFieldData;
template <class Mesh>
SbBool SoOpenMeshNodeT<Mesh>::firstInstance = TRUE;
template <class Mesh>
SoType SoOpenMeshNodeT<Mesh>::getTypeId() const {
return classTypeId;
}
template <class Mesh>
const SoFieldData*
SoOpenMeshNodeT<Mesh>::getFieldData() const {
SO__NODE_CHECK_CONSTRUCT("SoOpenMeshNodeT");
return fieldData;
}
template <class Mesh>
void* SoOpenMeshNodeT<Mesh>::createInstance() {
return (void *)(new SoOpenMeshNodeT<Mesh>);
}
#else
SO_NODE_SOURCE
(
SoOpenMeshNodeT
<
Mesh
>
);
#endif
//=============================================================================
}
// namespace OpenMesh
//=============================================================================
Apps/Unsupported/IvViewer/SoOpenMeshNodeT.hh
0 → 100644
View file @
56f447c3
//=============================================================================
//
// OpenMesh
// Copyright (C) 2003 by Computer Graphics Group, RWTH Aachen
// www.openmesh.org
//
//-----------------------------------------------------------------------------
//
// License
//
// This library 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, version 2.1.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//-----------------------------------------------------------------------------
//
// $Revision: 1800 $
// $Date: 2008-05-19 11:51:23 +0200 (Mo, 19. Mai 2008) $
//
//=============================================================================
//=============================================================================
//
// Class SoOpenMeshNode
//
// This class defines an basic inventor node to display an OpenMesh
//
//=============================================================================
#ifndef OPENMESH_SOOPENMESHNODE_HH
#define OPENMESH_SOOPENMESHNODE_HH
//== INCLUDES =================================================================
#include <OpenMesh/Core/Utils/GenProg.hh>
#include <Inventor/nodes/SoNode.h>
#include <Inventor/nodes/SoShape.h>
//== NAMESPACES ===============================================================
namespace
OpenMesh
{
//== CLASS DEFINITION =========================================================
template
<
class
Mesh
>
class
SoOpenMeshNodeT
:
public
SoShape
{
SO_NODE_HEADER
(
SoOpenMeshNodeT
<
Mesh
>
);
public:
static
void
initClass
();
SoOpenMeshNodeT
(
const
Mesh
*
_mesh
=
0
);
void
setMesh
(
const
Mesh
*
mesh
)
{
d_mesh
=
mesh
;
}
protected:
virtual
void
GLRender
(
SoGLRenderAction
*
action
);
virtual
void
computeBBox
(
SoAction
*
action
,
SbBox3f
&
box
,
SbVec3f
&
center
);
virtual
void
generatePrimitives
(
SoAction
*
action
);
private:
virtual
~
SoOpenMeshNodeT
()
{};
// Draw faces as triangles / polygons
void
drawFaces
(
bool
_send_normals
)
{
typedef
typename
Mesh
::
Face
Face
;
drawFaces
(
_send_normals
,
typename
Face
::
IsTriangle
());
}
void
drawFaces
(
bool
_send_normals
,
OpenMesh
::
GenProg
::
Bool2Type
<
true
>
);
void
drawFaces
(
bool
_send_normals
,
OpenMesh
::
GenProg
::
Bool2Type
<
false
>
);
// Generate primitives
void
genPrimitives
(
SoAction
*
_action
)
{
typedef
typename
Mesh
::
Face
Face
;
genPrimitives
(
_action
,
typename
Face
::
IsTriangle
());
}
void
genPrimitives
(
SoAction
*
_action
,
OpenMesh
::
GenProg
::
Bool2Type
<
true
>
);
void
genPrimitives
(
SoAction
*
_action
,
OpenMesh
::
GenProg
::
Bool2Type
<
false
>
);
const
Mesh
*
mesh_
;
};
//=============================================================================
}
// namespace OpenMesh
//=============================================================================
#if defined(INCLUDE_TEMPLATES) && !defined(OPENMESH_SOOPENMESHNODE_CC)
# define OPENMESH_SOOPENMESHMODE_TEMPLATES
# include "SoOpenMeshNodeT.cc"
#endif
//=============================================================================
#endif // OPENMESH_SOOPENMESHNODE_HH
//=============================================================================
Apps/Unsupported/IvViewer/SoOpenMeshSupport.hh
0 → 100644
View file @
56f447c3
#ifndef SOOPENMESHSUPPORT_H
#define SOOPENMESHSUPPORT_H
//== REDEFINE DEFINES SO THEY WORK WITH TEMPLATES ============================
#define SO_NODE_SOURCE_TEMPLATE template <class Mesh>
// ----------------------------------------------------------------- COIN ----
//
// define __COIN__ is set by coin headers
#ifdef __COIN__
#ifdef PRIVATE_NODE_TYPESYSTEM_SOURCE
# undef PRIVATE_NODE_TYPESYSTEM_SOURCE
#endif
#define PRIVATE_NODE_TYPESYSTEM_SOURCE(_class_) \
SO_NODE_SOURCE_TEMPLATE \
SoType _class_::getClassTypeId(void) { return _class_::classTypeId; } \
SO_NODE_SOURCE_TEMPLATE \
SoType _class_::getTypeId(void) const { return _class_::classTypeId; } \
/* Don't set value explicitly to SoType::badType(), to avoid a bug in */
\
/* Sun CC v4.0. (Bitpattern 0x0000 equals SoType::badType()). */
\
SO_NODE_SOURCE_TEMPLATE \
SoType _class_::classTypeId
// FIXME: document. 20000103 mortene.
#ifdef SO_NODE_ABSTRACT_SOURCE
# undef SO_NODE_ABSTRACT_SOURCE
#endif
#define SO_NODE_ABSTRACT_SOURCE(_class_) \
PRIVATE_NODE_TYPESYSTEM_SOURCE(_class_); \
\
SO_NODE_SOURCE_TEMPLATE \
unsigned int _class_::classinstances = 0; \
SO_NODE_SOURCE_TEMPLATE \
const SoFieldData ** _class_::parentFieldData = NULL; \
SO_NODE_SOURCE_TEMPLATE \
SoFieldData * _class_::fieldData = NULL; \
\
SO_NODE_SOURCE_TEMPLATE \
const SoFieldData ** \
_class_::getFieldDataPtr(void) \
{ \
return (const SoFieldData **)(&_class_::fieldData); \
} \
\
SO_NODE_SOURCE_TEMPLATE \
const SoFieldData * \
_class_::getFieldData(void) const \
{ \
return _class_::fieldData; \
}
// FIXME: document. 20000103 mortene.
#ifdef SO_NODE_SOURCE
# undef SO_NODE_SOURCE
#endif
#define SO_NODE_SOURCE(_class_) \
SO_NODE_ABSTRACT_SOURCE(_class_); \
\
SO_NODE_SOURCE_TEMPLATE \
void * \
_class_::createInstance(void) \
{ \
return new _class_; \
}