Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hurstel
CGoGN
Commits
588b0692
Commit
588b0692
authored
Feb 24, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Plain Diff
Merge cgogn:~thery/CGoGN
parents
797c28a9
8bfd76d1
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
520 additions
and
163 deletions
+520
-163
Apps/Tuto/tuto5.cpp
Apps/Tuto/tuto5.cpp
+4
-0
Apps/Tuto/tuto_oper2.cpp
Apps/Tuto/tuto_oper2.cpp
+98
-7
Apps/Tuto/tuto_oper2.h
Apps/Tuto/tuto_oper2.h
+5
-1
include/Algo/ImplicitHierarchicalMesh/ihm.h
include/Algo/ImplicitHierarchicalMesh/ihm.h
+3
-3
include/Algo/ImplicitHierarchicalMesh/ihm.hpp
include/Algo/ImplicitHierarchicalMesh/ihm.hpp
+3
-4
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+3
-3
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+3
-4
include/Algo/Render/GL2/topoRender.h
include/Algo/Render/GL2/topoRender.h
+8
-0
include/Algo/Render/GL2/topoRender.hpp
include/Algo/Render/GL2/topoRender.hpp
+2
-2
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+7
-7
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+4
-5
include/Topology/generic/mapBrowser.h
include/Topology/generic/mapBrowser.h
+6
-6
include/Topology/generic/traversorCell.hpp
include/Topology/generic/traversorCell.hpp
+2
-2
include/Utils/Qt/qtSimple.h
include/Utils/Qt/qtSimple.h
+6
-0
include/Utils/svg.h
include/Utils/svg.h
+73
-12
include/Utils/text3d.h
include/Utils/text3d.h
+5
-1
src/Algo/Render/topoRender.cpp
src/Algo/Render/topoRender.cpp
+7
-2
src/Utils/Qt/qtSimple.cpp
src/Utils/Qt/qtSimple.cpp
+6
-0
src/Utils/Qt/qtgl.cpp
src/Utils/Qt/qtgl.cpp
+4
-0
src/Utils/svg.cpp
src/Utils/svg.cpp
+259
-102
src/Utils/text3d.cpp
src/Utils/text3d.cpp
+12
-2
No files found.
Apps/Tuto/tuto5.cpp
View file @
588b0692
...
...
@@ -249,8 +249,11 @@ void MyQT::cb_keyPress(int code)
svg
.
setWidth
(
1.0
f
);
svg
.
setColor
(
Geom
::
Vec3f
(
0.0
f
,
0.0
f
,
0.5
f
));
Algo
::
Render
::
SVG
::
renderEdges
<
PFP
>
(
svg
,
myMap
,
position
);
svg
.
setColor
(
Geom
::
Vec3f
(
0.0
f
,
0.8
f
,
0.0
f
));
svg
.
setWidth
(
5.0
f
);
Algo
::
Render
::
SVG
::
renderVertices
<
PFP
>
(
svg
,
myMap
,
position
);
svg
.
setColor
(
Geom
::
Vec3f
(
1.0
f
,
0.0
f
,
0.0
f
));
m_strings
->
toSVG
(
svg
);
//svg destruction close the file
}
if
(
code
==
't'
)
...
...
@@ -333,6 +336,7 @@ int main(int argc, char **argv)
sqt
.
m_selected
=
myMap
.
begin
();
sqt
.
setGeometry
(
100
,
100
,
1024
,
1024
);
sqt
.
show
();
sqt
.
slider_balls
(
50
);
...
...
Apps/Tuto/tuto_oper2.cpp
View file @
588b0692
...
...
@@ -26,6 +26,9 @@
#include "Algo/Geometry/boundingbox.h"
#include "Algo/Modelisation/polyhedron.h"
#include "Algo/Geometry/centroid.h"
#include "Algo/Import/import.h"
#include "Algo/Export/export.h"
using
namespace
CGoGN
;
...
...
@@ -164,14 +167,10 @@ void MyQT::createMap(int n)
grid
.
grid_topo
(
n
,
n
);
grid
.
embedGrid
(
1.
,
1.
,
0.
);
// bounding box of scene
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
);
float
lWidthObj
=
std
::
max
<
PFP
::
REAL
>
(
std
::
max
<
PFP
::
REAL
>
(
bb
.
size
(
0
),
bb
.
size
(
1
)),
bb
.
size
(
2
));
Geom
::
Vec3f
lPosObj
=
(
bb
.
min
()
+
bb
.
max
())
/
PFP
::
REAL
(
2
);
// send BB info to interface for centering on GL screen
setParamObject
(
lWidthObj
,
lPosObj
.
data
());
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
setParamObject
(
bb
.
maxSize
(),
bb
.
center
().
data
())
;
m_shift
=
bb
.
maxSize
()
/
200.0
f
;
// first show for be sure that GL context is binded
show
();
...
...
@@ -296,6 +295,30 @@ void MyQT::cb_keyPress(int keycode)
}
}
break
;
case
Qt
::
Key_Up
:
if
(
m_selected
!=
NIL
)
position
[
m_selected
][
1
]
+=
m_shift
;
updateMap
();
updateGL
();
break
;
case
Qt
::
Key_Down
:
if
(
m_selected
!=
NIL
)
position
[
m_selected
][
1
]
-=
m_shift
;
updateMap
();
updateGL
();
break
;
case
Qt
::
Key_Left
:
if
(
m_selected
!=
NIL
)
position
[
m_selected
][
0
]
-=
m_shift
;
updateMap
();
updateGL
();
break
;
case
Qt
::
Key_Right
:
if
(
m_selected
!=
NIL
)
position
[
m_selected
][
0
]
+=
m_shift
;
updateMap
();
updateGL
();
break
;
}
updateGL
();
}
...
...
@@ -306,6 +329,74 @@ void MyQT::svg()
m_render_topo
->
svgout2D
(
filename
,
modelViewMatrix
(),
projectionMatrix
());
}
void
MyQT
::
cb_Open
()
{
std
::
string
filters
(
"all (*.*);; trian (*.trian);; off (*.off);; ply (*.ply);; map (*.map)"
)
;
std
::
string
filename
=
selectFile
(
"Open Mesh"
,
""
,
filters
)
;
if
(
!
filename
.
empty
())
importMesh
(
filename
);
updateGL
();
}
void
MyQT
::
cb_Save
()
{
std
::
string
filename
=
selectFileSave
(
"Export SVG file "
,
"."
,
"(*.off)"
);
Algo
::
Export
::
exportOFF
<
PFP
>
(
myMap
,
position
,
filename
.
c_str
());
}
void
MyQT
::
importMesh
(
std
::
string
&
filename
)
{
myMap
.
clear
(
true
)
;
size_t
pos
=
filename
.
rfind
(
"."
);
// position of "." in filename
std
::
string
extension
=
filename
.
substr
(
pos
);
if
(
extension
==
std
::
string
(
".map"
))
{
myMap
.
loadMapBin
(
filename
);
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
)
;
}
else
{
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
}
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
}
colorDarts
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
DART
,
"color"
);
if
(
!
colorDarts
.
isValid
())
{
colorDarts
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
DART
,
"color"
);
for
(
Dart
d
=
myMap
.
begin
();
d
!=
myMap
.
end
();
myMap
.
next
(
d
))
{
if
(
dm
.
isMarked
(
d
)
&&
(
!
myMap
.
isBoundaryMarked
(
d
)))
{
int
n
=
random
();
float
r
=
float
(
n
&
0x7f
)
/
255.0
f
+
0.25
f
;
float
g
=
float
((
n
>>
8
)
&
0x7f
)
/
255.0
f
+
0.25
f
;
float
b
=
float
((
n
>>
16
)
&
0x7f
)
/
255.0
+
0.25
f
;
colorDarts
[
d
]
=
Geom
::
Vec3f
(
r
,
g
,
b
);
m_render_topo
->
setDartColor
(
d
,
r
,
g
,
b
);
}
}
}
m_selected
=
NIL
;
m_selected2
=
NIL
;
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
setParamObject
(
bb
.
maxSize
(),
bb
.
center
().
data
())
;
m_shift
=
bb
.
maxSize
()
/
200.0
f
;
updateMap
();
updateGLMatrices
()
;
}
void
MyQT
::
width
(
int
w
)
{
m_render_topo
->
setDartWidth
(
w
);
...
...
Apps/Tuto/tuto_oper2.h
View file @
588b0692
...
...
@@ -67,12 +67,14 @@ class MyQT: public Utils::QT::SimpleQT
{
Q_OBJECT
public:
MyQT
()
:
nb
(
myMap
),
m_render_topo
(
NULL
),
m_selected
(
NIL
),
m_selected2
(
NIL
),
dm
(
myMap
)
{}
MyQT
()
:
nb
(
myMap
),
m_render_topo
(
NULL
),
m_selected
(
NIL
),
m_selected2
(
NIL
),
dm
(
myMap
)
,
m_shift
(
0.01
f
)
{}
void
cb_redraw
();
void
cb_initGL
();
void
cb_mousePress
(
int
button
,
int
x
,
int
y
);
void
cb_keyPress
(
int
code
);
void
cb_Open
();
void
cb_Save
();
Utils
::
QT
::
uiDockInterface
dock
;
...
...
@@ -90,6 +92,7 @@ protected:
Dart
m_selected
;
Dart
m_selected2
;
DartMarker
dm
;
float
m_shift
;
// just for more compact writing
inline
Dart
PHI1
(
Dart
d
)
{
return
myMap
.
phi1
(
d
);}
...
...
@@ -102,6 +105,7 @@ public:
// example of simple map creation
void
createMap
(
int
n
);
void
updateMap
();
void
importMesh
(
std
::
string
&
filename
);
public
slots
:
void
operation
(
int
x
);
...
...
include/Algo/ImplicitHierarchicalMesh/ihm.h
View file @
588b0692
...
...
@@ -87,11 +87,11 @@ public:
Dart
alpha_1
(
Dart
d
)
;
virtual
Dart
begin
()
;
virtual
Dart
begin
()
const
;
virtual
Dart
end
()
;
virtual
Dart
end
()
const
;
virtual
Dart
next
(
Dart
&
d
)
;
virtual
void
next
(
Dart
&
d
)
const
;
virtual
bool
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
;
...
...
include/Algo/ImplicitHierarchicalMesh/ihm.hpp
View file @
588b0692
...
...
@@ -139,7 +139,7 @@ inline Dart ImplicitHierarchicalMap::alpha_1(Dart d)
return
Map2
::
alpha_1
(
d
)
;
}
inline
Dart
ImplicitHierarchicalMap
::
begin
()
inline
Dart
ImplicitHierarchicalMap
::
begin
()
const
{
Dart
d
=
Map2
::
begin
()
;
while
(
d
!=
Map2
::
end
()
&&
m_dartLevel
[
d
]
>
m_curLevel
)
...
...
@@ -147,18 +147,17 @@ inline Dart ImplicitHierarchicalMap::begin()
return
d
;
}
inline
Dart
ImplicitHierarchicalMap
::
end
()
inline
Dart
ImplicitHierarchicalMap
::
end
()
const
{
return
Map2
::
end
()
;
}
inline
Dart
ImplicitHierarchicalMap
::
next
(
Dart
&
d
)
inline
void
ImplicitHierarchicalMap
::
next
(
Dart
&
d
)
const
{
do
{
Map2
::
next
(
d
)
;
}
while
(
d
!=
Map2
::
end
()
&&
m_dartLevel
[
d
]
>
m_curLevel
)
;
return
d
;
}
inline
bool
ImplicitHierarchicalMap
::
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
)
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.h
View file @
588b0692
...
...
@@ -360,11 +360,11 @@ public:
*************************************************************************/
//@{
virtual
Dart
begin
()
;
virtual
Dart
begin
()
const
;
virtual
Dart
end
()
;
virtual
Dart
end
()
const
;
virtual
Dart
next
(
Dart
&
d
)
;
virtual
void
next
(
Dart
&
d
)
const
;
virtual
bool
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
)
;
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
588b0692
...
...
@@ -200,7 +200,7 @@ inline Dart ImplicitHierarchicalMap3::alpha_2(Dart d)
return
phi2
(
phi3
(
d
));
}
inline
Dart
ImplicitHierarchicalMap3
::
begin
()
inline
Dart
ImplicitHierarchicalMap3
::
begin
()
const
{
Dart
d
=
Map3
::
begin
()
;
while
(
m_dartLevel
[
d
]
>
m_curLevel
)
...
...
@@ -208,18 +208,17 @@ inline Dart ImplicitHierarchicalMap3::begin()
return
d
;
}
inline
Dart
ImplicitHierarchicalMap3
::
end
()
inline
Dart
ImplicitHierarchicalMap3
::
end
()
const
{
return
Map3
::
end
()
;
}
inline
Dart
ImplicitHierarchicalMap3
::
next
(
Dart
&
d
)
inline
void
ImplicitHierarchicalMap3
::
next
(
Dart
&
d
)
const
{
do
{
Map3
::
next
(
d
)
;
}
while
(
d
!=
Map3
::
end
()
&&
m_dartLevel
[
d
]
>
m_curLevel
)
;
return
d
;
}
inline
bool
ImplicitHierarchicalMap3
::
foreach_dart_of_vertex
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
)
...
...
include/Algo/Render/GL2/topoRender.h
View file @
588b0692
...
...
@@ -245,6 +245,14 @@ public:
void
updateDataGMap
(
typename
PFP
::
MAP
&
map
,
const
typename
PFP
::
TVEC3
&
positions
,
float
ke
,
float
kf
,
const
FunctorSelect
&
good
=
allDarts
);
/**
* render to svg struct
*/
void
toSVG
(
Utils
::
SVG
::
SVGOut
&
svg
);
/**
* render svg into svg file
*/
void
svgout2D
(
const
std
::
string
&
filename
,
const
glm
::
mat4
&
model
,
const
glm
::
mat4
&
proj
);
};
...
...
include/Algo/Render/GL2/topoRender.hpp
View file @
588b0692
...
...
@@ -189,7 +189,7 @@ void TopoRender::updateDataMap(typename PFP::MAP& mapx, const typename PFP::TVEC
*
positionF1
++
=
fv1
[
d
];
*
positionF1
++
=
fv11
[
e
];
}
m_nbRel1
=
vecDarts
.
size
()
/
2
;
m_nbRel1
=
vecDarts
.
size
();
m_vbo1
->
bind
();
glUnmapBuffer
(
GL_ARRAY_BUFFER
);
...
...
@@ -204,7 +204,7 @@ template<typename PFP>
//void TopoRenderGMap::updateData(typename PFP::MAP& map, const typename PFP::TVEC3& positions, float ke, float kf, const FunctorSelect& good)
void
TopoRender
::
updateDataGMap
(
typename
PFP
::
MAP
&
mapx
,
const
typename
PFP
::
TVEC3
&
positions
,
float
ke
,
float
kf
,
const
FunctorSelect
&
good
)
{
GMap2
&
map
=
reinterpret
_cast
<
GMap2
&>
(
mapx
);
GMap2
&
map
=
dynamic
_cast
<
GMap2
&>
(
mapx
);
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
...
...
include/Topology/generic/genericmap.h
View file @
588b0692
...
...
@@ -53,9 +53,9 @@ namespace CGoGN
class
MapBrowser
{
public:
virtual
Dart
begin
()
=
0
;
virtual
Dart
end
()
=
0
;
virtual
Dart
next
(
Dart
&
d
)
=
0
;
virtual
Dart
begin
()
const
=
0
;
virtual
Dart
end
()
const
=
0
;
virtual
void
next
(
Dart
&
d
)
const
=
0
;
};
class
AttributeHandlerGen
;
...
...
@@ -259,7 +259,7 @@ public:
/**
* get the insertion level of a dart (use only in MRMaps)
*/
unsigned
int
getDartLevel
(
Dart
d
)
;
unsigned
int
getDartLevel
(
Dart
d
)
const
;
/**
* get the number of darts inserted in the given leveldart (use only in MRMaps)
...
...
@@ -526,20 +526,20 @@ public:
* Begin of map
* @return the first dart of the map
*/
Dart
begin
()
;
Dart
begin
()
const
;
/**
* End of map
* @return the end iterator (next of last) of the map
*/
Dart
end
()
;
Dart
end
()
const
;
/**
* allow to go from a dart to the next
* in the order of storage
* @param d reference to the dart to be modified
*/
Dart
next
(
Dart
&
d
)
;
void
next
(
Dart
&
d
)
const
;
/**
* Apply a functor on each dart of the map
...
...
include/Topology/generic/genericmap.hpp
View file @
588b0692
...
...
@@ -194,7 +194,7 @@ inline unsigned int GenericMap::dartIndex(Dart d) const
return
d
.
index
;
}
inline
unsigned
int
GenericMap
::
getDartLevel
(
Dart
d
)
inline
unsigned
int
GenericMap
::
getDartLevel
(
Dart
d
)
const
{
return
(
*
m_mrLevels
)[
d
.
index
]
;
}
...
...
@@ -339,7 +339,7 @@ inline AttributeMultiVector<unsigned int>* GenericMap::getEmbeddingAttributeVect
* DARTS TRAVERSALS *
****************************************/
inline
Dart
GenericMap
::
begin
()
inline
Dart
GenericMap
::
begin
()
const
{
if
(
m_isMultiRes
)
{
...
...
@@ -352,7 +352,7 @@ inline Dart GenericMap::begin()
return
Dart
::
create
(
m_attribs
[
DART
].
begin
())
;
}
inline
Dart
GenericMap
::
end
()
inline
Dart
GenericMap
::
end
()
const
{
if
(
m_isMultiRes
)
return
Dart
::
create
(
m_mrattribs
.
end
())
;
...
...
@@ -360,7 +360,7 @@ inline Dart GenericMap::end()
return
Dart
::
create
(
m_attribs
[
DART
].
end
())
;
}
inline
Dart
GenericMap
::
next
(
Dart
&
d
)
inline
void
GenericMap
::
next
(
Dart
&
d
)
const
{
if
(
m_isMultiRes
)
{
...
...
@@ -371,7 +371,6 @@ inline Dart GenericMap::next(Dart& d)
}
else
m_attribs
[
DART
].
next
(
d
.
index
)
;
return
d
;
}
/****************************************
...
...
include/Topology/generic/mapBrowser.h
View file @
588b0692
...
...
@@ -47,17 +47,17 @@ public:
m_map
(
m
),
m_selector
(
fs
)
{}
Dart
begin
()
Dart
begin
()
const
{
return
m_map
.
begin
()
;
}
Dart
end
()
Dart
end
()
const
{
return
m_map
.
end
()
;
}
void
next
(
Dart
&
d
)
void
next
(
Dart
&
d
)
const
{
do
{
...
...
@@ -112,17 +112,17 @@ public:
m_end
=
NIL
;
}
Dart
begin
()
Dart
begin
()
const
{
return
m_first
;
}
Dart
end
()
Dart
end
()
const
{
return
NIL
;
}
void
next
(
Dart
&
d
)
void
next
(
Dart
&
d
)
const
{
assert
(
d
!=
NIL
)
;
d
=
m_links
[
d
]
;
...
...
include/Topology/generic/traversorCell.hpp
View file @
588b0692
...
...
@@ -57,7 +57,7 @@ Dart TraversorCell<MAP>::begin()
current
=
m
.
begin
()
;
while
(
current
!=
m
.
end
()
&&
(
m
.
isBoundaryMarked
(
current
)
||
!
m_good
(
current
)))
current
=
m
.
next
(
current
)
;
m
.
next
(
current
)
;
if
(
current
==
m
.
end
())
current
=
NIL
;
...
...
@@ -92,7 +92,7 @@ Dart TraversorCell<MAP>::next()
while
(
current
!=
NIL
&&
(
ismarked
||
m
.
isBoundaryMarked
(
current
)
||
!
m_good
(
current
)))
{
current
=
m
.
next
(
current
)
;
m
.
next
(
current
)
;
if
(
current
==
m
.
end
())
current
=
NIL
;
else
...
...
include/Utils/Qt/qtSimple.h
View file @
588b0692
...
...
@@ -200,6 +200,12 @@ public:
*/
void
setFocal
(
float
f
)
{
m_glWidget
->
setFocal
(
f
);
}
/**
* set geometry (override buggy Qt function)
*/
void
setGeometry
(
int
x
,
int
y
,
int
w
,
int
h
);
/**
* get the mouse position in GL widget
*/
...
...
include/Utils/svg.h
View file @
588b0692
...
...
@@ -28,6 +28,7 @@
#include <vector>
#include <fstream>
#include <sstream>
#include <string>
#include "Geometry/vector_gen.h"
...
...
@@ -48,11 +49,24 @@ namespace SVG
{
struct
DepthSort
{
unsigned
int
obj
;
unsigned
int
id
;
float
depth
;
DepthSort
(
unsigned
int
o
,
unsigned
int
i
,
float
d
)
:
obj
(
o
),
id
(
i
),
depth
(
d
)
{}
bool
operator
<
(
const
DepthSort
&
ds
)
const
{
return
depth
>
ds
.
depth
;
/* inverse depth sortin*/
}
};
class
SvgObj
{
protected:
std
::
vector
<
Geom
::
Vec3f
>
m_vertices
;
std
::
vector
<
Geom
::
Vec3f
>
m_colors
;
std
::
vector
<
std
::
string
>
m_strings
;
std
::
vector
<
Geom
::
Vec3f
>
m_vertices3D
;
Geom
::
Vec3f
m_color
;
float
m_width
;
...
...
@@ -67,16 +81,26 @@ public:
void
addVertex3D
(
const
Geom
::
Vec3f
&
v
,
const
Geom
::
Vec3f
&
C
);
void
addString
(
const
Geom
::
Vec3f
&
v
,
const
std
::
string
&
str
);
void
addString
(
const
Geom
::
Vec3f
&
v
,
const
std
::
string
&
str
,
const
Geom
::
Vec3f
&
C
);
void
setColor
(
const
Geom
::
Vec3f
&
c
);
void
setWidth
(
float
w
);
void
close
();
virtual
void
save
(
std
::
ofstream
&
out
)
=
0
;
virtual
void
save
(
std
::
ofstream
&
out
)
const
=
0
;
virtual
void
saveOne
(
std
::
ofstream
&
out
,
unsigned
int
i
,
unsigned
int
bbl
=
0
)
const
=
0
;
unsigned
int
nbv
()
const
;
virtual
unsigned
int
nbPrimtives
()
const
=
0
;
virtual
void
fillDS
(
std
::
vector
<
DepthSort
>&
vds
,
unsigned
int
idObj
)
const
=
0
;
const
Geom
::
Vec3f
&
P
(
unsigned
int
i
)
const
;
Geom
::
Vec3f
normal
();
...
...
@@ -88,30 +112,50 @@ public:
class
SvgPoints
:
public
SvgObj
{
public:
void
save
(
std
::
ofstream
&
out
);
void
save
(
std
::
ofstream
&
out
)
const
;
void
saveOne
(
std
::
ofstream
&
out
,
unsigned
int
i
,
unsigned
int
bbl
=
0
)
const
;
unsigned
int
nbPrimtives
()
const
;
void
fillDS
(
std
::
vector
<
DepthSort
>&
vds
,
unsigned
int
idObj
)
const
;
};
class
SvgLines
:
public
SvgObj
{
public:
void
save
(
std
::
ofstream
&
out
);
void
save
(
std
::
ofstream
&
out
)
const
;
void
saveOne
(
std
::
ofstream
&
out
,
unsigned
int
i
,
unsigned
int
bbl
=
0
)
const
;
unsigned
int
nbPrimtives
()
const
;
void
fillDS
(
std
::
vector
<
DepthSort
>&
vds
,
unsigned
int
idObj
)
const
;
};
class
SvgPolyline
:
public
SvgObj
{
public:
void
save
(
std
::
ofstream
&
out
);
};
class
Svg
Polygon
:
public
SvgObj
class
Svg
Strings
:
public
SvgObj
{
protected:
Geom
::
Vec3f
m_colorFill
;
float
m_sf
;
public:
void
setColorFill
(
const
Geom
::
Vec3f
&
c
);
void
save
(
std
::
ofstream
&
out
);
SvgStrings
(
float
scalefactor
=
1.0
f
)
:
m_sf
(
scalefactor
)
{}
void
save
(
std
::
ofstream
&
out
)
const
;
void
saveOne
(
std
::
ofstream
&
out
,
unsigned
int
i
,
unsigned
int
bbl
=
0
)
const
;
unsigned
int
nbPrimtives
()
const
;
void
fillDS
(
std
::
vector
<
DepthSort
>&
vds
,
unsigned
int
idObj
)
const
;
};
//class SvgPolyline: public SvgObj
//{
//public:
// void save(std::ofstream& out);
//};
//
//class SvgPolygon: public SvgObj
//{
//protected:
// Geom::Vec3f m_colorFill;
//public:
// void setColorFill(const Geom::Vec3f& c);
// void save(std::ofstream& out);
//};
class
SVGOut
...
...
@@ -129,6 +173,14 @@ protected:
std
::
vector
<
SvgObj
*>
m_objs
;
SvgObj
*
m_current
;
unsigned
int
m_bbX0
;
unsigned
int
m_bbY0
;
unsigned
int
m_bbX1
;
unsigned
int
m_bbY1
;
protected:
void
computeBB
(
unsigned
int
&
a
,
unsigned
int
&
b
,
unsigned
int
&
c
,
unsigned
&
d
);
...
...
@@ -165,6 +217,15 @@ public: