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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
7192da78
Commit
7192da78
authored
Sep 11, 2013
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renderTopo plugin + PrimitiveSelector (not finished)
parent
1346483a
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1040 additions
and
815 deletions
+1040
-815
SCHNApps/CMakeLists.txt
SCHNApps/CMakeLists.txt
+1
-1
SCHNApps/Plugins/CMakeLists.txt
SCHNApps/Plugins/CMakeLists.txt
+1
-0
SCHNApps/Plugins/surface_render/forms/surface_render.ui
SCHNApps/Plugins/surface_render/forms/surface_render.ui
+1
-1
SCHNApps/Plugins/surface_renderTopo/CMakeLists.txt
SCHNApps/Plugins/surface_renderTopo/CMakeLists.txt
+4
-4
SCHNApps/Plugins/surface_renderTopo/forms/surface_renderTopo.ui
...ps/Plugins/surface_renderTopo/forms/surface_renderTopo.ui
+55
-53
SCHNApps/Plugins/surface_renderTopo/include/renderTopoSurface.h
...ps/Plugins/surface_renderTopo/include/renderTopoSurface.h
+0
-112
SCHNApps/Plugins/surface_renderTopo/include/surface_renderTopo.h
...s/Plugins/surface_renderTopo/include/surface_renderTopo.h
+103
-0
SCHNApps/Plugins/surface_renderTopo/include/surface_renderTopo_dockTab.h
...s/surface_renderTopo/include/surface_renderTopo_dockTab.h
+51
-0
SCHNApps/Plugins/surface_renderTopo/src/renderTopoSurface.cpp
...Apps/Plugins/surface_renderTopo/src/renderTopoSurface.cpp
+0
-380
SCHNApps/Plugins/surface_renderTopo/src/renderTopoSurfaceDockTab.cpp
...ugins/surface_renderTopo/src/renderTopoSurfaceDockTab.cpp
+0
-208
SCHNApps/Plugins/surface_renderTopo/src/surface_renderTopo.cpp
...pps/Plugins/surface_renderTopo/src/surface_renderTopo.cpp
+223
-0
SCHNApps/Plugins/surface_renderTopo/src/surface_renderTopo_dockTab.cpp
...ins/surface_renderTopo/src/surface_renderTopo_dockTab.cpp
+218
-0
SCHNApps/Plugins/surface_renderVector/include/surface_renderVector_dockTab.h
...rface_renderVector/include/surface_renderVector_dockTab.h
+0
-1
SCHNApps/Plugins/surface_renderVector/src/surface_renderVector_dockTab.cpp
...surface_renderVector/src/surface_renderVector_dockTab.cpp
+2
-0
SCHNApps/Plugins/surface_subdivision/forms/dialog_surface_subdivision.ui
...s/surface_subdivision/forms/dialog_surface_subdivision.ui
+1
-1
SCHNApps/forms/controlDock_MapTabWidget.ui
SCHNApps/forms/controlDock_MapTabWidget.ui
+362
-40
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+6
-2
SCHNApps/src/controlDock_mapTab.cpp
SCHNApps/src/controlDock_mapTab.cpp
+10
-10
SCHNApps/src/mapHandler.cpp
SCHNApps/src/mapHandler.cpp
+2
-2
No files found.
SCHNApps/CMakeLists.txt
View file @
7192da78
...
...
@@ -137,7 +137,7 @@ SET(SCHNApps_QOBJECT_FILES
${
SCHNApps_ROOT_DIR
}
/include/controlDock_cameraTab.h
${
SCHNApps_ROOT_DIR
}
/include/controlDock_pluginTab.h
${
SCHNApps_ROOT_DIR
}
/include/controlDock_mapTab.h
#
${SCHNApps_ROOT_DIR}/include/colorComboBox.h
${
SCHNApps_ROOT_DIR
}
/include/colorComboBox.h
)
...
...
SCHNApps/Plugins/CMakeLists.txt
View file @
7192da78
...
...
@@ -4,5 +4,6 @@ ADD_SUBDIRECTORY(surface_import)
ADD_SUBDIRECTORY
(
surface_render
)
ADD_SUBDIRECTORY
(
surface_renderVector
)
ADD_SUBDIRECTORY
(
surface_renderScalar
)
ADD_SUBDIRECTORY
(
surface_renderTopo
)
ADD_SUBDIRECTORY
(
surface_differentialProperties
)
ADD_SUBDIRECTORY
(
surface_subdivision
)
SCHNApps/Plugins/surface_render/forms/surface_render.ui
View file @
7192da78
...
...
@@ -7,7 +7,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
200
</width>
<height>
6
21
</height>
<height>
6
00
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
SCHNApps/Plugins/surface_renderTopo/CMakeLists.txt
View file @
7192da78
cmake_minimum_required
(
VERSION 2.8
)
SET
(
PLUGIN_NAME
RenderTopoSurface
)
SET
(
PLUGIN_NAME
Surface_RenderTopo
)
SET
(
PLUGIN_ROOT_DIR
${
SCHNApps_ROOT_DIR
}
/Plugins/
renderTopoSurface
)
SET
(
PLUGIN_ROOT_DIR
${
SCHNApps_ROOT_DIR
}
/Plugins/
surface_renderTopo
)
INCLUDE_DIRECTORIES
(
${
PLUGIN_ROOT_DIR
}
/include
...
...
@@ -25,8 +25,8 @@ file(
SET
(
PLUGIN_QOBJECT_FILES
${
PLUGIN_ROOT_DIR
}
/include/
renderTopoSurface
.h
${
PLUGIN_ROOT_DIR
}
/include/
renderTopoSurfaceD
ockTab.h
${
PLUGIN_ROOT_DIR
}
/include/
surface_renderTopo
.h
${
PLUGIN_ROOT_DIR
}
/include/
surface_renderTopo_d
ockTab.h
)
include
(
${
SCHNApps_ROOT_DIR
}
/Plugins/plugins_cmake.txt
)
SCHNApps/Plugins/surface_renderTopo/forms/
renderTopoSurface
.ui
→
SCHNApps/Plugins/surface_renderTopo/forms/
surface_renderTopo
.ui
View file @
7192da78
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
RenderTopoSurfaceDock
Widget
</class>
<widget
class=
"QWidget"
name=
"
RenderTopoSurfaceDock
Widget"
>
<class>
Surface_RenderTopo_Tab
Widget
</class>
<widget
class=
"QWidget"
name=
"
Surface_RenderTopo_Tab
Widget"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
19
0
</width>
<height>
547
</height>
<width>
20
0
</width>
<height>
600
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"0"
column=
"0"
colspan=
"4"
>
<widget
class=
"QListWidget"
name=
"mapList"
/>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Position :
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
colspan=
"3"
>
<widget
class=
"QComboBox"
name=
"combo_positionAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
<item
row=
"2"
column=
"3"
>
<widget
class=
"ColorComboBox"
name=
"combo_phi1Color"
/>
</item>
<item
row=
"
2
"
column=
"0"
colspan=
"3"
>
<widget
class=
"QCheckBox"
name=
"check_draw
Darts
"
>
<item
row=
"
3
"
column=
"0"
colspan=
"3"
>
<widget
class=
"QCheckBox"
name=
"check_draw
Phi2
"
>
<property
name=
"text"
>
<string>
draw
darts
</string>
<string>
draw
phi2
</string>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"2"
column=
"3"
>
<widget
class=
"ColorComboBox"
name=
"combo_dartsColor"
/>
</item>
<item
row=
"3"
column=
"0"
colspan=
"3"
>
<item
row=
"2"
column=
"0"
colspan=
"3"
>
<widget
class=
"QCheckBox"
name=
"check_drawPhi1"
>
<property
name=
"text"
>
<string>
draw phi1
</string>
...
...
@@ -57,30 +37,35 @@
</property>
</widget>
</item>
<item
row=
"
3
"
column=
"3"
>
<widget
class=
"ColorComboBox"
name=
"combo_
phi1
Color"
/>
<item
row=
"
1
"
column=
"3"
>
<widget
class=
"ColorComboBox"
name=
"combo_
darts
Color"
/>
</item>
<item
row=
"
4"
column=
"0
"
colspan=
"3"
>
<widget
class=
"QC
heckBox"
name=
"check_drawPhi2
"
>
<property
name=
"
text
"
>
<s
tring>
draw phi2
</string
>
</property
>
<property
name=
"checked"
>
<
bool>
true
</bool
>
<item
row=
"
0"
column=
"1
"
colspan=
"3"
>
<widget
class=
"QC
omboBox"
name=
"combo_positionAttribute
"
>
<property
name=
"
sizePolicy
"
>
<s
izepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch
>
<verstretch>
0
</verstretch
>
<
/sizepolicy
>
</property>
<item>
<property
name=
"text"
>
<string>
- select attribute -
</string>
</property>
</item>
</widget>
</item>
<item
row=
"4"
column=
"3"
>
<widget
class=
"ColorComboBox"
name=
"combo_phi2Color"
/>
</item>
<item
row=
"5"
column=
"0"
colspan=
"2"
>
<item
row=
"4"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
explod edges
</string>
</property>
</widget>
</item>
<item
row=
"5"
column=
"2"
colspan=
"2"
>
<item
row=
"3"
column=
"3"
>
<widget
class=
"ColorComboBox"
name=
"combo_phi2Color"
/>
</item>
<item
row=
"4"
column=
"2"
colspan=
"2"
>
<widget
class=
"QSlider"
name=
"slider_edgesScaleFactor"
>
<property
name=
"value"
>
<number>
50
</number>
...
...
@@ -90,14 +75,7 @@
</property>
</widget>
</item>
<item
row=
"6"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
explod faces
</string>
</property>
</widget>
</item>
<item
row=
"6"
column=
"2"
colspan=
"2"
>
<item
row=
"5"
column=
"2"
colspan=
"2"
>
<widget
class=
"QSlider"
name=
"slider_facesScaleFactor"
>
<property
name=
"value"
>
<number>
50
</number>
...
...
@@ -107,7 +85,7 @@
</property>
</widget>
</item>
<item
row=
"
7
"
column=
"0"
colspan=
"4"
>
<item
row=
"
6
"
column=
"0"
colspan=
"4"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
...
...
@@ -120,6 +98,30 @@
</property>
</spacer>
</item>
<item
row=
"5"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
explod faces
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
colspan=
"3"
>
<widget
class=
"QCheckBox"
name=
"check_drawDarts"
>
<property
name=
"text"
>
<string>
draw darts
</string>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Position :
</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
...
...
SCHNApps/Plugins/surface_renderTopo/include/renderTopoSurface.h
deleted
100644 → 0
View file @
1346483a
#ifndef _RENDERTOPO_SURFACE_PLUGIN_H_
#define _RENDERTOPO_SURFACE_PLUGIN_H_
#include "plugin.h"
#include "renderTopoSurfaceDockTab.h"
#include "Algo/Render/GL2/topoRender.h"
namespace
CGoGN
{
namespace
SCHNApps
{
struct
PerMapParameterSet
{
PerMapParameterSet
(
MapHandlerGen
*
mh
);
~
PerMapParameterSet
();
void
updateRender
();
MapHandlerGen
*
mh
;
Algo
::
Render
::
GL2
::
TopoRender
*
m_renderTopo
;
VertexAttribute
<
PFP2
::
VEC3
>
positionAttribute
;
bool
drawDarts
;
QColor
dartsColor
;
bool
drawPhi1
;
QColor
phi1Color
;
bool
drawPhi2
;
QColor
phi2Color
;
float
edgesScaleFactor
;
float
facesScaleFactor
;
};
struct
ParameterSet
{
ParameterSet
()
:
selectedMap
(
NULL
)
{}
QHash
<
QString
,
PerMapParameterSet
*>
perMap
;
MapHandlerGen
*
selectedMap
;
};
class
RenderTopoSurfacePlugin
:
public
Plugin
{
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
public:
RenderTopoSurfacePlugin
()
{
setProvidesRendering
(
true
);
}
~
RenderTopoSurfacePlugin
()
{}
virtual
bool
enable
();
virtual
void
disable
();
virtual
void
redraw
(
View
*
view
);
virtual
void
keyPress
(
View
*
view
,
QKeyEvent
*
event
)
{}
virtual
void
keyRelease
(
View
*
view
,
QKeyEvent
*
event
)
{}
virtual
void
mousePress
(
View
*
view
,
QMouseEvent
*
event
);
virtual
void
mouseRelease
(
View
*
view
,
QMouseEvent
*
event
)
{}
virtual
void
mouseMove
(
View
*
view
,
QMouseEvent
*
event
)
{}
virtual
void
wheelEvent
(
View
*
view
,
QWheelEvent
*
event
)
{}
protected:
RenderTopoSurfaceDockTab
*
m_dockTab
;
QHash
<
View
*
,
ParameterSet
*>
h_viewParams
;
public
slots
:
void
viewLinked
(
View
*
view
,
Plugin
*
plugin
);
void
viewUnlinked
(
View
*
view
,
Plugin
*
plugin
);
void
currentViewChanged
(
View
*
view
);
void
mapLinked
(
MapHandlerGen
*
m
);
void
mapUnlinked
(
MapHandlerGen
*
m
);
protected:
void
addManagedMap
(
View
*
v
,
MapHandlerGen
*
m
);
void
removeManagedMap
(
View
*
v
,
MapHandlerGen
*
m
);
public
slots
:
void
changeSelectedMap
(
View
*
view
,
MapHandlerGen
*
map
);
void
changePositionAttribute
(
View
*
view
,
MapHandlerGen
*
map
,
VertexAttribute
<
PFP2
::
VEC3
>
attribute
,
bool
fromUI
=
false
);
void
changeDrawDarts
(
View
*
view
,
MapHandlerGen
*
map
,
bool
b
,
bool
fromUI
=
false
);
void
changeDartsColor
(
View
*
view
,
MapHandlerGen
*
map
,
QColor
c
,
bool
fromUI
=
false
);
void
changeDrawPhi1
(
View
*
view
,
MapHandlerGen
*
map
,
bool
b
,
bool
fromUI
=
false
);
void
changePhi1Color
(
View
*
view
,
MapHandlerGen
*
map
,
QColor
c
,
bool
fromUI
=
false
);
void
changeDrawPhi2
(
View
*
view
,
MapHandlerGen
*
map
,
bool
b
,
bool
fromUI
=
false
);
void
changePhi2Color
(
View
*
view
,
MapHandlerGen
*
map
,
QColor
c
,
bool
fromUI
=
false
);
void
changeEdgesScaleFactor
(
View
*
view
,
MapHandlerGen
*
map
,
int
i
,
bool
fromUI
=
false
);
void
changeFacesScaleFactor
(
View
*
view
,
MapHandlerGen
*
map
,
int
i
,
bool
fromUI
=
false
);
void
attributeModified
(
unsigned
int
orbit
,
QString
nameAttr
);
void
connectivityModified
();
signals:
void
dartSelected
(
Dart
d
);
};
}
// namespace SCHNApps
}
// namespace CGoGN
#endif
SCHNApps/Plugins/surface_renderTopo/include/surface_renderTopo.h
0 → 100644
View file @
7192da78
#ifndef _SURFACE_RENDERTOPO_PLUGIN_H_
#define _SURFACE_RENDERTOPO_PLUGIN_H_
#include "plugin_interaction.h"
#include "surface_renderTopo_dockTab.h"
#include "Algo/Render/GL2/topoRender.h"
namespace
CGoGN
{
namespace
SCHNApps
{
struct
MapParameters
{
MapParameters
()
:
drawDarts
(
true
),
dartsColor
(
"white"
),
drawPhi1
(
true
),
phi1Color
(
"cyan"
),
drawPhi2
(
true
),
phi2Color
(
"red"
),
edgesScaleFactor
(
1.0
f
),
facesScaleFactor
(
1.0
f
)
{}
VertexAttribute
<
PFP2
::
VEC3
>
positionAttribute
;
bool
drawDarts
;
QColor
dartsColor
;
bool
drawPhi1
;
QColor
phi1Color
;
bool
drawPhi2
;
QColor
phi2Color
;
float
edgesScaleFactor
;
float
facesScaleFactor
;
};
class
Surface_RenderTopo_Plugin
:
public
PluginInteraction
{
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
friend
class
Surface_RenderTopo_DockTab
;
public:
Surface_RenderTopo_Plugin
()
{}
~
Surface_RenderTopo_Plugin
()
{}
virtual
bool
enable
();
virtual
void
disable
();
virtual
void
draw
(
View
*
view
)
{}
virtual
void
drawMap
(
View
*
view
,
MapHandlerGen
*
map
);
virtual
void
keyPress
(
View
*
view
,
QKeyEvent
*
event
)
{}
virtual
void
keyRelease
(
View
*
view
,
QKeyEvent
*
event
)
{}
virtual
void
mousePress
(
View
*
view
,
QMouseEvent
*
event
)
{}
virtual
void
mouseRelease
(
View
*
view
,
QMouseEvent
*
event
)
{}
virtual
void
mouseMove
(
View
*
view
,
QMouseEvent
*
event
)
{}
virtual
void
wheelEvent
(
View
*
view
,
QWheelEvent
*
event
)
{}
virtual
void
viewLinked
(
View
*
view
)
{}
virtual
void
viewUnlinked
(
View
*
view
)
{}
private
slots
:
// slots called from SCHNApps signals
void
selectedViewChanged
(
View
*
prev
,
View
*
cur
);
void
selectedMapChanged
(
MapHandlerGen
*
prev
,
MapHandlerGen
*
cur
);
void
mapAdded
(
MapHandlerGen
*
map
);
void
mapRemoved
(
MapHandlerGen
*
map
);
// slots called from MapHandler signals
void
attributeAdded
(
unsigned
int
orbit
,
const
QString
&
nameAttr
);
public
slots
:
// slots for Python calls
// void changePositionAttribute(const QString& view, const QString& map, const QString& attrName);
// void changeDrawDarts(const QString& view, const QString& map, bool b);
// void changeDartsColor(const QString& view, const QString& map, QColor c);
// void changeDrawPhi1(const QString& view, const QString& map, bool b);
// void changePhi1Color(const QString& view, const QString& map, QColor c);
// void changeDrawPhi2(const QString& view, const QString& map, bool b);
// void changePhi2Color(const QString& view, const QString& map, QColor c);
// void changeEdgesScaleFactor(const QString& view, const QString& map, int i);
// void changeFacesScaleFactor(const QString& view, const QString& map, int i);
//signals:
// void dartSelected(Dart d);
protected:
Surface_RenderTopo_DockTab
*
m_dockTab
;
QHash
<
View
*
,
QHash
<
MapHandlerGen
*
,
MapParameters
>
>
h_viewParameterSet
;
};
}
// namespace SCHNApps
}
// namespace CGoGN
#endif
SCHNApps/Plugins/surface_renderTopo/include/
renderTopoSurfaceD
ockTab.h
→
SCHNApps/Plugins/surface_renderTopo/include/
surface_renderTopo_d
ockTab.h
View file @
7192da78
#ifndef _
RENDER_TOPO_SURFACE
_DOCK_TAB_H_
#define _
RENDER_TOPO_SURFACE
_DOCK_TAB_H_
#ifndef _
SURFACE_RENDERTOPO
_DOCK_TAB_H_
#define _
SURFACE_RENDERTOPO
_DOCK_TAB_H_
#include "ui_
renderTopoSurface
.h"
#include "ui_
surface_renderTopo
.h"
namespace
CGoGN
{
...
...
@@ -9,27 +9,25 @@ namespace CGoGN
namespace
SCHNApps
{
class
Window
;
class
RenderTopoSurface
Plugin
;
struct
ParameterSet
;
class
SCHNApps
;
class
Surface_RenderTopo_
Plugin
;
struct
MapParameters
;
class
RenderTopoSurfaceDockTab
:
public
QWidget
,
public
Ui
::
RenderTopoSurfaceDock
Widget
class
Surface_RenderTopo_DockTab
:
public
QWidget
,
public
Ui
::
Surface_RenderTopo_Tab
Widget
{
Q_OBJECT
friend
class
Surface_RenderTopo_Plugin
;
public:
RenderTopoSurfaceDockTab
(
Window
*
w
,
RenderTopoSurface
Plugin
*
p
);
Surface_RenderTopo_DockTab
(
SCHNApps
*
s
,
Surface_RenderTopo_
Plugin
*
p
);
private:
Window
*
m_window
;
RenderTopoSurfacePlugin
*
m_plugin
;
ParameterSet
*
m_currentParams
;
bool
b_refreshingUI
;
public
slots
:
void
refreshUI
(
ParameterSet
*
params
);
SCHNApps
*
m_schnapps
;
Surface_RenderTopo_Plugin
*
m_plugin
;
bool
b_updatingUI
;
void
selectedMapChanged
();
private
slots
:
void
positionAttributeChanged
(
int
index
);
void
drawDartsChanged
(
bool
b
);
void
dartsColorChanged
(
int
);
...
...
@@ -40,7 +38,10 @@ public slots:
void
edgesScaleFactorChanged
(
int
i
);
void
facesScaleFactorChanged
(
int
i
);
private:
void
addAttributeToList
(
unsigned
int
orbit
,
const
QString
&
nameAttr
);
void
updateMapParameters
();
};
}
// namespace SCHNApps
...
...
SCHNApps/Plugins/surface_renderTopo/src/renderTopoSurface.cpp
deleted
100644 → 0
View file @
1346483a
#include "renderTopoSurface.h"
#include "mapHandler.h"
namespace
CGoGN
{
namespace
SCHNApps
{
PerMapParameterSet
::
PerMapParameterSet
(
MapHandlerGen
*
m
)
:
mh
(
m
),
drawDarts
(
true
),
dartsColor
(
"white"
),
drawPhi1
(
true
),
phi1Color
(
"cyan"
),
drawPhi2
(
true
),
phi2Color
(
"red"
),
edgesScaleFactor
(
1.0
f
),
facesScaleFactor
(
1.0
f
)
{
m_renderTopo
=
new
Algo
::
Render
::
GL2
::
TopoRender
();
QString
positionName
;
QString
vec3TypeName
=
QString
::
fromStdString
(
nameOfType
(
PFP2
::
VEC3
()));
const
AttributeHash
&
attribs
=
mh
->
getAttributesList
(
VERTEX
);
for
(
AttributeHash
::
const_iterator
i
=
attribs
.
constBegin
();
i
!=
attribs
.
constEnd
();
++
i
)
{
if
(
i
.
value
()
==
vec3TypeName
)
{
if
(
positionName
!=
"position"
)
// try to select an attribute named "position"
positionName
=
i
.
key
();
// or anything else if not found
}
}
positionAttribute
=
mh
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
positionName
);
updateRender
();
}
PerMapParameterSet
::~
PerMapParameterSet
()
{
delete
m_renderTopo
;
}
void
PerMapParameterSet
::
updateRender
()
{
PFP2
::
MAP
*
m
=
static_cast
<
MapHandler
<
PFP2
>*>
(
mh
)
->
getMap
();
m_renderTopo
->
updateData
<
PFP2
>
(
*
m
,
positionAttribute
,
edgesScaleFactor
,
facesScaleFactor
);
}
bool
RenderTopoSurfacePlugin
::
enable
()
{
m_dockTab
=
new
RenderTopoSurfaceDockTab
(
m_window
,
this
);
addTabInDock
(
m_dockTab
,
"RenderTopoSurface"
);
connect
(
m_window
,
SIGNAL
(
viewAndPluginLinked
(
View
*
,
Plugin
*
)),
this
,
SLOT
(
viewLinked
(
View
*
,
Plugin
*
)));
connect
(
m_window
,
SIGNAL
(
viewAndPluginUnlinked
(
View
*
,
Plugin
*
)),
this
,
SLOT
(
viewUnlinked
(
View
*
,
Plugin
*
)));
connect
(
m_window
,
SIGNAL
(
currentViewChanged
(
View
*
)),
this
,
SLOT
(
currentViewChanged
(
View
*
)));
return
true
;
}
void
RenderTopoSurfacePlugin
::
disable
()
{
}
void
RenderTopoSurfacePlugin
::
redraw
(
View
*
view
)
{
ParameterSet
*
params
=
h_viewParams
[
view
];
const
QList
<
MapHandlerGen
*>&
maps
=
view
->
getLinkedMaps
();
foreach
(
MapHandlerGen
*
m
,
maps
)
{
PerMapParameterSet
*
p
=
params
->
perMap
[
m
->
getName
()];
if
(
p
->
drawDarts
)
p
->
m_renderTopo
->
drawDarts
();
if
(
p
->
drawPhi1
)
p
->
m_renderTopo
->
drawRelation1
();
if
(
p
->
drawPhi2
)
p
->
m_renderTopo
->
drawRelation2
();
}
}
void
RenderTopoSurfacePlugin
::
mousePress
(
View
*
view
,
QMouseEvent
*
event
)
{
// if (Shift())
// {
// ParameterSet* params = h_viewParams[view];
// m_renderTopo->updateData<PFP>(myMap, position, m_coeff_topo_explod[0], m_coeff_topo_explod[1], m_coeff_topo_explod[2], *m_selNoBoundary) ;