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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
aadb3d36
Commit
aadb3d36
authored
Dec 20, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps: new plugin for differential properties + user selection of VBOs for render plugin
parent
84bb3a4d
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
654 additions
and
129 deletions
+654
-129
SCHNApps/Plugins/CMakeLists.txt
SCHNApps/Plugins/CMakeLists.txt
+1
-0
SCHNApps/Plugins/differentialProperties/CMakeLists.txt
SCHNApps/Plugins/differentialProperties/CMakeLists.txt
+75
-0
SCHNApps/Plugins/differentialProperties/computeNormalsDialog.ui
...ps/Plugins/differentialProperties/computeNormalsDialog.ui
+81
-0
SCHNApps/Plugins/differentialProperties/differentialProperties.cpp
...Plugins/differentialProperties/differentialProperties.cpp
+32
-0
SCHNApps/Plugins/differentialProperties/differentialProperties.h
...s/Plugins/differentialProperties/differentialProperties.h
+75
-0
SCHNApps/Plugins/importSurface/CMakeLists.txt
SCHNApps/Plugins/importSurface/CMakeLists.txt
+1
-1
SCHNApps/Plugins/importSurface/importSurface.cpp
SCHNApps/Plugins/importSurface/importSurface.cpp
+4
-13
SCHNApps/Plugins/render/render.cpp
SCHNApps/Plugins/render/render.cpp
+217
-73
SCHNApps/Plugins/render/render.h
SCHNApps/Plugins/render/render.h
+35
-10
SCHNApps/Plugins/render/render.ui
SCHNApps/Plugins/render/render.ui
+68
-1
SCHNApps/Plugins/renderVector/renderVector.cpp
SCHNApps/Plugins/renderVector/renderVector.cpp
+3
-2
SCHNApps/Plugins/renderVector/renderVector.h
SCHNApps/Plugins/renderVector/renderVector.h
+4
-11
SCHNApps/Plugins/renderVector/renderVector.ui
SCHNApps/Plugins/renderVector/renderVector.ui
+1
-1
SCHNApps/Plugins/subdivideSurface/CMakeLists.txt
SCHNApps/Plugins/subdivideSurface/CMakeLists.txt
+1
-1
SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp
SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp
+20
-8
SCHNApps/Plugins/subdivideSurface/subdivideSurface.h
SCHNApps/Plugins/subdivideSurface/subdivideSurface.h
+11
-1
SCHNApps/Plugins/subdivideSurface/subdivideSurface.ui
SCHNApps/Plugins/subdivideSurface/subdivideSurface.ui
+1
-1
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+17
-1
SCHNApps/include/window.h
SCHNApps/include/window.h
+1
-1
SCHNApps/src/plugin.cpp
SCHNApps/src/plugin.cpp
+3
-1
SCHNApps/src/window.cpp
SCHNApps/src/window.cpp
+2
-2
src/Utils/Shaders/shaderFlat.cpp
src/Utils/Shaders/shaderFlat.cpp
+1
-1
No files found.
SCHNApps/Plugins/CMakeLists.txt
View file @
aadb3d36
cmake_minimum_required
(
VERSION 2.8
)
cmake_minimum_required
(
VERSION 2.8
)
ADD_SUBDIRECTORY
(
importSurface
)
ADD_SUBDIRECTORY
(
importSurface
)
ADD_SUBDIRECTORY
(
differentialProperties
)
ADD_SUBDIRECTORY
(
render
)
ADD_SUBDIRECTORY
(
render
)
ADD_SUBDIRECTORY
(
renderVector
)
ADD_SUBDIRECTORY
(
renderVector
)
ADD_SUBDIRECTORY
(
subdivideSurface
)
ADD_SUBDIRECTORY
(
subdivideSurface
)
SCHNApps/Plugins/differentialProperties/CMakeLists.txt
0 → 100644
View file @
aadb3d36
cmake_minimum_required
(
VERSION 2.8
)
INCLUDE_DIRECTORIES
(
${
SCHNApps_ROOT_DIR
}
/include
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties
${
CMAKE_CURRENT_BINARY_DIR
}
)
SET
(
PLUGIN_SRC
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/differentialProperties.cpp
)
SET
(
PLUGIN_H
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/differentialProperties.h
)
SET
(
PLUGIN_FORM
${
SCHNApps_ROOT_DIR
}
/Plugins/differentialProperties/computeNormalsDialog.ui
)
IF
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
ADD_DEFINITIONS
(
-DDEBUG
)
IF
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ELSE
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Debug
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ENDIF
(
WIN32
)
QT4_WRAP_UI
(
PLUGIN_UI
${
PLUGIN_FORM
}
)
QT4_WRAP_CPP
(
PLUGIN_MOC
${
PLUGIN_H
}
)
ADD_LIBRARY
(
DifferentialPropertiesPluginD SHARED
${
PLUGIN_SRC
}
${
PLUGIN_UI
}
${
PLUGIN_MOC
}
)
TARGET_LINK_LIBRARIES
(
DifferentialPropertiesPluginD
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QGLVIEWER_LIBRARIES
}
)
ADD_DEPENDENCIES
(
DifferentialPropertiesPluginD SCHNAppsD
)
SET_TARGET_PROPERTIES
(
DifferentialPropertiesPluginD PROPERTIES COMPILE_DEFINITIONS
"DEBUG"
)
ELSE
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
IF
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ELSE
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ENDIF
(
WIN32
)
QT4_WRAP_UI
(
PLUGIN_UI
${
PLUGIN_FORM
}
)
QT4_WRAP_CPP
(
PLUGIN_MOC
${
PLUGIN_H
}
)
ADD_LIBRARY
(
DifferentialPropertiesPlugin SHARED
${
PLUGIN_SRC
}
${
PLUGIN_UI
}
${
PLUGIN_MOC
}
)
TARGET_LINK_LIBRARIES
(
DifferentialPropertiesPlugin
${
CGoGN_LIBS_R
}
${
COMMON_LIBS
}
${
QGLVIEWER_LIBRARIES
}
)
ADD_DEPENDENCIES
(
DifferentialPropertiesPlugin SCHNApps
)
ENDIF
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
SCHNApps/Plugins/differentialProperties/computeNormalsDialog.ui
0 → 100644
View file @
aadb3d36
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
ComputeNormalsDialog
</class>
<widget
class=
"QDialog"
name=
"ComputeNormalsDialog"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
400
</width>
<height>
223
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Compute Normals
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QListWidget"
name=
"mapList"
/>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Attribute name :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"attributeName"
/>
</item>
</layout>
</item>
<item>
<widget
class=
"QDialogButtonBox"
name=
"buttonBox"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"standardButtons"
>
<set>
QDialogButtonBox::Cancel|QDialogButtonBox::Ok
</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>
buttonBox
</sender>
<signal>
accepted()
</signal>
<receiver>
ComputeNormalsDialog
</receiver>
<slot>
accept()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
248
</x>
<y>
254
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
157
</x>
<y>
274
</y>
</hint>
</hints>
</connection>
<connection>
<sender>
buttonBox
</sender>
<signal>
rejected()
</signal>
<receiver>
ComputeNormalsDialog
</receiver>
<slot>
reject()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
316
</x>
<y>
260
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
286
</x>
<y>
274
</y>
</hint>
</hints>
</connection>
</connections>
</ui>
SCHNApps/Plugins/differentialProperties/differentialProperties.cpp
0 → 100644
View file @
aadb3d36
#include "differentialProperties.h"
#include "mapHandler.h"
#include "Algo/Geometry/normal.h"
bool
DifferentialPropertiesPlugin
::
enable
()
{
m_computeNormalsDialog
=
new
ComputeNormalsDialog
();
computeNormalsAction
=
new
QAction
(
"import"
,
this
);
addMenuAction
(
"Surface;DifferentialProperties;Compute Normals"
,
computeNormalsAction
);
connect
(
computeNormalsAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cb_computeNormals
()));
return
true
;
}
void
DifferentialPropertiesPlugin
::
cb_computeNormals
()
{
m_computeNormalsDialog
->
mapList
->
clear
();
m_computeNormalsDialog
->
attributeName
->
setText
(
"normal"
);
const
QList
<
MapHandlerGen
*>&
maps
=
m_window
->
getMapsList
();
foreach
(
MapHandlerGen
*
map
,
maps
)
m_computeNormalsDialog
->
mapList
->
addItem
(
map
->
getName
());
m_computeNormalsDialog
->
show
();
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2
(
DifferentialPropertiesPlugin
,
DifferentialPropertiesPlugin
)
#else
Q_EXPORT_PLUGIN2
(
DifferentialPropertiesPluginD
,
DifferentialPropertiesPlugin
)
#endif
SCHNApps/Plugins/differentialProperties/differentialProperties.h
0 → 100644
View file @
aadb3d36
#ifndef _DIFFERENTIALPROPERTIES_PLUGIN_H_
#define _DIFFERENTIALPROPERTIES_PLUGIN_H_
#include "plugin.h"
#include "ui_computeNormalsDialog.h"
#include "Topology/generic/functor.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
#include "Topology/generic/attributeHandler.h"
using
namespace
CGoGN
;
using
namespace
SCHNApps
;
struct
PFP
:
public
PFP_STANDARD
{
typedef
EmbeddedMap2
MAP
;
};
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
VEC3
VEC3
;
class
ComputeNormalsDialog
:
public
QDialog
,
public
Ui
::
ComputeNormalsDialog
{
public:
ComputeNormalsDialog
()
{
setupUi
(
this
);
}
};
class
DifferentialPropertiesPlugin
:
public
Plugin
{
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
public:
DifferentialPropertiesPlugin
()
{
setProvidesRendering
(
false
);
}
~
DifferentialPropertiesPlugin
()
{}
virtual
bool
enable
();
virtual
void
disable
()
{}
virtual
void
redraw
(
View
*
view
)
{}
virtual
void
keyPress
(
View
*
view
,
int
key
)
{}
virtual
void
keyRelease
(
View
*
view
,
int
key
)
{}
virtual
void
mousePress
(
View
*
view
,
int
button
,
int
x
,
int
y
)
{}
virtual
void
mouseRelease
(
View
*
view
,
int
button
,
int
x
,
int
y
)
{}
virtual
void
mouseMove
(
View
*
view
,
int
buttons
,
int
x
,
int
y
)
{}
virtual
void
wheelEvent
(
View
*
view
,
int
delta
,
int
x
,
int
y
)
{}
virtual
void
viewLinked
(
View
*
view
)
{}
virtual
void
viewUnlinked
(
View
*
view
)
{}
virtual
void
currentViewChanged
(
View
*
view
)
{}
virtual
void
mapLinked
(
View
*
view
,
MapHandlerGen
*
m
)
{}
virtual
void
mapUnlinked
(
View
*
view
,
MapHandlerGen
*
m
)
{}
public
slots
:
void
cb_computeNormals
();
private:
ComputeNormalsDialog
*
m_computeNormalsDialog
;
QAction
*
computeNormalsAction
;
};
#endif
SCHNApps/Plugins/importSurface/CMakeLists.txt
View file @
aadb3d36
...
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)
...
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)
INCLUDE_DIRECTORIES
(
INCLUDE_DIRECTORIES
(
${
SCHNApps_ROOT_DIR
}
/include
${
SCHNApps_ROOT_DIR
}
/include
${
SCHNApps_ROOT_DIR
}
/Plugins/import
${
SCHNApps_ROOT_DIR
}
/Plugins/import
Surface
${
CMAKE_CURRENT_BINARY_DIR
}
${
CMAKE_CURRENT_BINARY_DIR
}
)
)
...
...
SCHNApps/Plugins/importSurface/importSurface.cpp
View file @
aadb3d36
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
bool
ImportSurfacePlugin
::
enable
()
bool
ImportSurfacePlugin
::
enable
()
{
{
importAction
=
new
QAction
(
"import"
,
this
);
importAction
=
new
QAction
(
"import"
,
this
);
addMenuAction
(
"
Import;Import Surface
"
,
importAction
);
addMenuAction
(
"
Surface;Import
"
,
importAction
);
connect
(
importAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cb_import
()));
connect
(
importAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cb_import
()));
return
true
;
return
true
;
}
}
...
@@ -34,22 +34,13 @@ void ImportSurfacePlugin::cb_import()
...
@@ -34,22 +34,13 @@ void ImportSurfacePlugin::cb_import()
// create VBO for vertex position attribute
// create VBO for vertex position attribute
h
->
createVBO
(
position
);
h
->
createVBO
(
position
);
// compute vertex normal attribute
VertexAttribute
<
VEC3
>
normal
=
m
->
getAttribute
<
VEC3
,
CGoGN
::
VERTEX
>
(
"normal"
);
if
(
!
normal
.
isValid
())
normal
=
m
->
addAttribute
<
VEC3
,
CGoGN
::
VERTEX
>
(
"normal"
);
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
*
m
,
position
,
normal
);
// create VBO for vertex normal attribute
h
->
createVBO
(
normal
);
// compute map bounding box
// compute map bounding box
h
->
updateBB
(
position
);
h
->
updateBB
(
position
);
// compute primitive connectivity VBOs
// compute primitive connectivity VBOs
h
->
updatePrimitives
(
CGoGN
::
Algo
::
Render
::
GL2
::
POINTS
,
CGoGN
::
allDarts
);
h
->
updatePrimitives
(
Algo
::
Render
::
GL2
::
POINTS
);
h
->
updatePrimitives
(
CGoGN
::
Algo
::
Render
::
GL2
::
LINES
,
CGoGN
::
allDarts
);
h
->
updatePrimitives
(
Algo
::
Render
::
GL2
::
LINES
);
h
->
updatePrimitives
(
CGoGN
::
Algo
::
Render
::
GL2
::
TRIANGLES
,
CGoGN
::
allDarts
);
h
->
updatePrimitives
(
Algo
::
Render
::
GL2
::
TRIANGLES
);
m_window
->
addMap
(
h
);
m_window
->
addMap
(
h
);
}
}
...
...
SCHNApps/Plugins/render/render.cpp
View file @
aadb3d36
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
bool
RenderPlugin
::
enable
()
bool
RenderPlugin
::
enable
()
{
{
m_dockTab
=
new
RenderDockTab
();
m_dockTab
=
new
RenderDockTab
(
this
);
addTabInDock
(
m_dockTab
,
"Render"
);
addTabInDock
(
m_dockTab
,
"Render"
);
m_flatShader
=
new
CGoGN
::
Utils
::
ShaderFlat
();
m_flatShader
=
new
CGoGN
::
Utils
::
ShaderFlat
();
...
@@ -31,6 +31,10 @@ bool RenderPlugin::enable()
...
@@ -31,6 +31,10 @@ bool RenderPlugin::enable()
registerShader
(
m_simpleColorShader
);
registerShader
(
m_simpleColorShader
);
registerShader
(
m_pointSprite
);
registerShader
(
m_pointSprite
);
connect
(
m_dockTab
->
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
cb_selectedMapChanged
()));
connect
(
m_dockTab
->
combo_positionVBO
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
cb_positionVBOChanged
(
int
)));
connect
(
m_dockTab
->
combo_normalVBO
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
cb_normalVBOChanged
(
int
)));
connect
(
m_dockTab
->
button_refreshVBOs
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
cb_refreshVBOs
()));
connect
(
m_dockTab
->
check_renderVertices
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
cb_renderVerticesChanged
(
bool
)));
connect
(
m_dockTab
->
check_renderVertices
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
cb_renderVerticesChanged
(
bool
)));
connect
(
m_dockTab
->
slider_verticesScaleFactor
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
cb_verticesScaleFactorChanged
(
int
)));
connect
(
m_dockTab
->
slider_verticesScaleFactor
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
cb_verticesScaleFactorChanged
(
int
)));
connect
(
m_dockTab
->
check_renderEdges
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
cb_renderEdgesChanged
(
bool
)));
connect
(
m_dockTab
->
check_renderEdges
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
cb_renderEdgesChanged
(
bool
)));
...
@@ -55,54 +59,68 @@ void RenderPlugin::redraw(View* view)
...
@@ -55,54 +59,68 @@ void RenderPlugin::redraw(View* view)
const
QList
<
MapHandlerGen
*>&
maps
=
view
->
getLinkedMaps
();
const
QList
<
MapHandlerGen
*>&
maps
=
view
->
getLinkedMaps
();
foreach
(
MapHandlerGen
*
m
,
maps
)
foreach
(
MapHandlerGen
*
m
,
maps
)
{
{
CGoGN
::
Utils
::
VBO
*
positionVBO
=
m
->
getVBO
(
"position"
);
const
PerMapParameterSet
&
p
=
params
->
perMap
[
m
->
getName
()];
CGoGN
::
Utils
::
VBO
*
normalVBO
=
m
->
getVBO
(
"normal"
);
if
(
p
.
positionVBO
!=
NULL
)
if
(
params
->
renderVertices
)
{
{
m_pointSprite
->
setSize
(
m
->
getBBdiagSize
()
/
200.0
f
*
params
->
verticesScaleFactor
);
if
(
p
.
renderVertices
)
m_pointSprite
->
setAttributePosition
(
positionVBO
);
{
m_pointSprite
->
setSize
(
m
->
getBBdiagSize
()
/
200.0
f
*
p
.
verticesScaleFactor
);
m_pointSprite
->
setAttributePosition
(
p
.
positionVBO
);
m_pointSprite
->
predraw
(
CGoGN
::
Geom
::
Vec3f
(
0.0
f
,
0.0
f
,
1.0
f
));
m_pointSprite
->
predraw
(
CGoGN
::
Geom
::
Vec3f
(
0.0
f
,
0.0
f
,
1.0
f
));
m
->
draw
(
m_pointSprite
,
CGoGN
::
Algo
::
Render
::
GL2
::
POINTS
);
m
->
draw
(
m_pointSprite
,
CGoGN
::
Algo
::
Render
::
GL2
::
POINTS
);
m_pointSprite
->
postdraw
();
m_pointSprite
->
postdraw
();
}
}
if
(
params
->
renderEdges
)
if
(
p
.
renderEdges
)
{
{
glLineWidth
(
1.0
f
);
glLineWidth
(
1.0
f
);
m_simpleColorShader
->
setAttributePosition
(
positionVBO
);
m_simpleColorShader
->
setAttributePosition
(
p
.
positionVBO
);
m
->
draw
(
m_simpleColorShader
,
CGoGN
::
Algo
::
Render
::
GL2
::
LINES
);
m
->
draw
(
m_simpleColorShader
,
CGoGN
::
Algo
::
Render
::
GL2
::
LINES
);
}
}
if
(
params
->
renderFaces
)
if
(
p
.
renderFaces
)
{
{
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_FILL
);
glEnable
(
GL_LIGHTING
);
glEnable
(
GL_LIGHTING
);
glEnable
(
GL_POLYGON_OFFSET_FILL
);
glEnable
(
GL_POLYGON_OFFSET_FILL
);
glPolygonOffset
(
1.0
f
,
1.0
f
);
glPolygonOffset
(
1.0
f
,
1.0
f
);
switch
(
params
->
faceStyle
)
switch
(
p
.
faceStyle
)
{
{
case
FLAT
:
case
FLAT
:
m_flatShader
->
setAttributePosition
(
positionVBO
);
m_flatShader
->
setAttributePosition
(
p
.
positionVBO
);
m
->
draw
(
m_flatShader
,
CGoGN
::
Algo
::
Render
::
GL2
::
TRIANGLES
);
m
->
draw
(
m_flatShader
,
CGoGN
::
Algo
::
Render
::
GL2
::
TRIANGLES
);
break
;
break
;
case
PHONG
:
case
PHONG
:
m_phongShader
->
setAttributePosition
(
positionVBO
)
;
if
(
p
.
normalVBO
!=
NULL
)
m_phongShader
->
setAttributeNormal
(
normalVBO
)
;
{
m_phongShader
->
setAttributePosition
(
p
.
positionVBO
)
;
m_phongShader
->
setAttributeNormal
(
p
.
normalVBO
)
;
m
->
draw
(
m_phongShader
,
CGoGN
::
Algo
::
Render
::
GL2
::
TRIANGLES
);
m
->
draw
(
m_phongShader
,
CGoGN
::
Algo
::
Render
::
GL2
::
TRIANGLES
);
}
break
;
break
;
}
}
glDisable
(
GL_POLYGON_OFFSET_FILL
);
glDisable
(
GL_POLYGON_OFFSET_FILL
);
}
}
}
}
}
}
}
void
RenderPlugin
::
viewLinked
(
View
*
view
)
void
RenderPlugin
::
viewLinked
(
View
*
view
)
{
{
h_viewParams
.
insert
(
view
,
new
ParameterSet
());
ParameterSet
*
params
=
new
ParameterSet
();
m_dockTab
->
refreshUI
(
h_viewParams
[
view
]);
h_viewParams
.
insert
(
view
,
params
);
const
QList
<
MapHandlerGen
*>&
maps
=
view
->
getLinkedMaps
();
foreach
(
MapHandlerGen
*
map
,
maps
)
{
PerMapParameterSet
p
;
params
->
perMap
.
insert
(
map
->
getName
(),
p
);
}
m_dockTab
->
refreshUI
(
params
);
}
}
void
RenderPlugin
::
viewUnlinked
(
View
*
view
)
void
RenderPlugin
::
viewUnlinked
(
View
*
view
)
{
{
h_viewParams
.
remove
(
view
);
h_viewParams
.
remove
(
view
);
View
*
current
=
m_window
->
getCurrentView
();
View
*
current
=
m_window
->
getCurrentView
();
if
(
isLinkedToView
(
current
))
if
(
isLinkedToView
(
current
))
m_dockTab
->
refreshUI
(
h_viewParams
[
current
]);
m_dockTab
->
refreshUI
(
h_viewParams
[
current
]);
...
@@ -114,69 +132,195 @@ void RenderPlugin::currentViewChanged(View* view)
...
@@ -114,69 +132,195 @@ void RenderPlugin::currentViewChanged(View* view)
m_dockTab
->
refreshUI
(
h_viewParams
[
view
]);
m_dockTab
->
refreshUI
(
h_viewParams
[
view
]);
}
}
void
RenderPlugin
::
cb_renderVerticesChanged
(
bool
b
)
void
RenderPlugin
::
mapLinked
(
View
*
view
,
MapHandlerGen
*
m
)
{
{
assert
(
isLinkedToView
(
view
));
ParameterSet
*
params
=
h_viewParams
[
view
];
PerMapParameterSet
p
;
params
->
perMap
.
insert
(
m
->
getName
(),
p
);
m_dockTab
->
refreshUI
(
params
);
}
void
RenderPlugin
::
mapUnlinked
(
View
*
view
,
MapHandlerGen
*
m
)
{
assert
(
isLinkedToView
(
view
));
ParameterSet
*
params
=
h_viewParams
[
view
];
params
->
perMap
.
remove
(
m
->
getName
());
if
(
params
->
selectedMap
==
m
)
{
params
->
selectedMap
=
NULL
;
m_dockTab
->
refreshUI
(
params
);
}
}
void
RenderPlugin
::
cb_selectedMapChanged
()
{
if
(
!
b_refreshingUI
)
{
View
*
view
=
m_window
->
getCurrentView
();
ParameterSet
*
params
=
h_viewParams
[
view
];
QList
<
QListWidgetItem
*>
currentItems
=
m_dockTab
->
mapList
->
selectedItems
();
if
(
!
currentItems
.
empty
())
{
const
QString
&
mapname
=
currentItems
[
0
]
->
text
();
params
->
selectedMap
=
m_window
->
getMap
(
mapname
);
m_dockTab
->
refreshUI
(
params
);
view
->
updateGL
();
}
}
}
void
RenderPlugin
::
cb_positionVBOChanged
(
int
index
)
{
if
(
!
b_refreshingUI
)
{
View
*
current
=
m_window
->
getCurrentView
();
View
*
current
=
m_window
->
getCurrentView
();
assert
(
isLinkedToView
(
current
));
ParameterSet
*
params
=
h_viewParams
[
current
];
MapHandlerGen
*
map
=
params
->
selectedMap
;
params
->
perMap
[
map
->
getName
()].
positionVBO
=
map
->
getVBO
(
m_dockTab
->
combo_positionVBO
->
currentText
());
current
->
updateGL
();
}
}
void
RenderPlugin
::
cb_normalVBOChanged
(
int
index
)
{
if
(
!
b_refreshingUI
)
{
View
*
current
=
m_window
->
getCurrentView
();
ParameterSet
*
params
=
h_viewParams
[
current
];
ParameterSet
*
params
=
h_viewParams
[
current
];
params
->
renderVertices
=
b
;
MapHandlerGen
*
map
=
params
->
selectedMap
;
params
->
perMap
[
map
->
getName
()].
normalVBO
=
map
->
getVBO
(
m_dockTab
->
combo_normalVBO
->
currentText
());
current
->
updateGL
();
current
->
updateGL
();
}
}
}
void
RenderPlugin
::
cb_
verticesScaleFactorChanged
(
int
i
)
void
RenderPlugin
::
cb_
refreshVBOs
(
)
{
{
View
*
current
=
m_window
->
getCurrentView
();
View
*
current
=
m_window
->
getCurrentView
();
assert
(
isLinkedToView
(
current
));
if
(
isLinkedToView
(
current
))
m_dockTab
->
refreshUI
(
h_viewParams
[
current
]);
}
void
RenderPlugin
::
cb_renderVerticesChanged
(
bool
b
)
{
if
(
!
b_refreshingUI
)
{
View
*
current
=
m_window
->
getCurrentView
();
ParameterSet
*
params
=
h_viewParams
[
current
];
ParameterSet
*
params
=
h_viewParams
[
current
];
params
->
verticesScaleFactor
=
i
/
50.0
;
MapHandlerGen
*
m
=
params
->
selectedMap
;
params
->
perMap
[
m
->
getName
()].
renderVertices
=
b
;
current
->
updateGL
();
current
->
updateGL
();
}
}
}
void
RenderPlugin
::
cb_
renderEdgesChanged
(
bool
b
)
void
RenderPlugin
::
cb_
verticesScaleFactorChanged
(
int
i
)
{
{
if
(
!
b_refreshingUI
)
{
View
*
current
=
m_window
->
getCurrentView
();
View
*
current
=
m_window
->
getCurrentView
();