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
d11304b9
Commit
d11304b9
authored
Mar 04, 2015
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps: select dynamically the vertex attribute to use to compute the map bounding box
parent
ba254fb4
Changes
36
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
635 additions
and
846 deletions
+635
-846
CGoGN/include/Container/attributeContainer.h
CGoGN/include/Container/attributeContainer.h
+5
-19
CGoGN/include/Container/attributeContainer.hpp
CGoGN/include/Container/attributeContainer.hpp
+1
-14
CGoGN/include/Geometry/bounding_box.hpp
CGoGN/include/Geometry/bounding_box.hpp
+0
-2
CGoGN/include/Topology/generic/genericmap.h
CGoGN/include/Topology/generic/genericmap.h
+0
-1
CGoGN/src/Container/attributeContainer.cpp
CGoGN/src/Container/attributeContainer.cpp
+2
-6
SCHNApps/Plugins/surface_deformation/src/surface_deformation.cpp
...s/Plugins/surface_deformation/src/surface_deformation.cpp
+10
-12
SCHNApps/Plugins/surface_differentialProperties/include/surface_differentialProperties.h
...entialProperties/include/surface_differentialProperties.h
+1
-1
SCHNApps/Plugins/surface_differentialProperties/src/surface_differentialProperties.cpp
...erentialProperties/src/surface_differentialProperties.cpp
+3
-3
SCHNApps/Plugins/surface_distance/include/surface_distance.h
SCHNApps/Plugins/surface_distance/include/surface_distance.h
+1
-1
SCHNApps/Plugins/surface_distance/src/dialog_computeDistance.cpp
...s/Plugins/surface_distance/src/dialog_computeDistance.cpp
+4
-4
SCHNApps/Plugins/surface_distance/src/surface_distance.cpp
SCHNApps/Plugins/surface_distance/src/surface_distance.cpp
+3
-3
SCHNApps/Plugins/surface_import/src/surface_import.cpp
SCHNApps/Plugins/surface_import/src/surface_import.cpp
+7
-9
SCHNApps/Plugins/surface_modelisation/src/surface_modelisation.cpp
...Plugins/surface_modelisation/src/surface_modelisation.cpp
+5
-12
SCHNApps/Plugins/surface_radiance/src/surface_radiance.cpp
SCHNApps/Plugins/surface_radiance/src/surface_radiance.cpp
+0
-6
SCHNApps/Plugins/surface_render/include/surface_render.h
SCHNApps/Plugins/surface_render/include/surface_render.h
+1
-1
SCHNApps/Plugins/surface_render/src/surface_render.cpp
SCHNApps/Plugins/surface_render/src/surface_render.cpp
+4
-10
SCHNApps/Plugins/surface_render/src/surface_render_dockTab.cpp
...pps/Plugins/surface_render/src/surface_render_dockTab.cpp
+27
-27
SCHNApps/Plugins/surface_subdivision/include/surface_subdivision.h
...Plugins/surface_subdivision/include/surface_subdivision.h
+1
-1
SCHNApps/Plugins/surface_subdivision/src/surface_subdivision.cpp
...s/Plugins/surface_subdivision/src/surface_subdivision.cpp
+5
-1
SCHNApps/Plugins/volume_import/src/volume_import.cpp
SCHNApps/Plugins/volume_import/src/volume_import.cpp
+8
-8
SCHNApps/forms/controlDock_CameraTabWidget.ui
SCHNApps/forms/controlDock_CameraTabWidget.ui
+1
-1
SCHNApps/forms/controlDock_MapTabWidget.ui
SCHNApps/forms/controlDock_MapTabWidget.ui
+21
-0
SCHNApps/include/camera.h
SCHNApps/include/camera.h
+4
-19
SCHNApps/include/controlDock_cameraTab.h
SCHNApps/include/controlDock_cameraTab.h
+7
-13
SCHNApps/include/controlDock_mapTab.h
SCHNApps/include/controlDock_mapTab.h
+2
-6
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+33
-16
SCHNApps/include/mapHandler.hpp
SCHNApps/include/mapHandler.hpp
+99
-100
SCHNApps/include/schnapps.h
SCHNApps/include/schnapps.h
+1
-1
SCHNApps/include/view.h
SCHNApps/include/view.h
+17
-11
SCHNApps/src/camera.cpp
SCHNApps/src/camera.cpp
+24
-118
SCHNApps/src/controlDock_cameraTab.cpp
SCHNApps/src/controlDock_cameraTab.cpp
+78
-46
SCHNApps/src/controlDock_mapTab.cpp
SCHNApps/src/controlDock_mapTab.cpp
+157
-239
SCHNApps/src/controlDock_pluginTab.cpp
SCHNApps/src/controlDock_pluginTab.cpp
+2
-9
SCHNApps/src/mapHandler.cpp
SCHNApps/src/mapHandler.cpp
+8
-3
SCHNApps/src/schnapps.cpp
SCHNApps/src/schnapps.cpp
+1
-37
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+92
-86
No files found.
CGoGN/include/Container/attributeContainer.h
View file @
d11304b9
...
...
@@ -64,7 +64,7 @@ public:
* the management of holes is shared by all attributes
*/
class
CGoGN_CONTAINER_API
AttributeContainer
class
CGoGN_CONTAINER_API
AttributeContainer
{
public:
/**
...
...
@@ -156,7 +156,7 @@ public:
void
setRegistry
(
std
::
map
<
std
::
string
,
RegisteredBaseAttribute
*>*
re
);
void
setContainerBrowser
(
ContainerBrowser
*
bro
)
{
m_currentBrowser
=
bro
;}
void
setContainerBrowser
(
ContainerBrowser
*
bro
)
{
m_currentBrowser
=
bro
;
}
bool
hasBrowser
()
{
return
m_currentBrowser
!=
NULL
;
}
...
...
@@ -176,7 +176,6 @@ public:
/// special version for marker
AttributeMultiVector
<
MarkerBool
>*
addMarkerAttribute
(
const
std
::
string
&
attribName
);
/**
* add a new attribute to the container
* @param typeName type of the new attribute in a string
...
...
@@ -185,7 +184,6 @@ public:
*/
AttributeMultiVectorGen
*
addAttribute
(
const
std
::
string
&
typeName
,
const
std
::
string
&
attribName
);
protected:
/**
* add a new attribute with a given index (for load only)
...
...
@@ -275,8 +273,6 @@ public:
*/
void
next
(
unsigned
int
&
it
)
const
;
/**
* return the index of the first line of the container
*/
...
...
@@ -293,7 +289,6 @@ public:
*/
void
realNext
(
unsigned
int
&
it
)
const
;
/**
* return the index of the last line of the container
*/
...
...
@@ -334,7 +329,7 @@ public:
* @return number of blocks
*/
template
<
typename
T
>
unsigned
int
getAttributeBlocksPointers
(
unsigned
int
attrIndex
,
std
::
vector
<
T
*>&
vect_ptr
,
unsigned
int
&
byteBlockSize
);
unsigned
int
getAttributeBlocksPointers
(
unsigned
int
attrIndex
,
std
::
vector
<
T
*>&
vect_ptr
,
unsigned
int
&
byteBlockSize
)
const
;
/**
* fill a vector with attributes names
...
...
@@ -343,13 +338,12 @@ public:
*/
unsigned
int
getAttributesNames
(
std
::
vector
<
std
::
string
>&
names
)
const
;
/**
* fill a vector with attribute type names
* @param types vector of type names
* @return number of attributes
*/
unsigned
int
getAttributesTypes
(
std
::
vector
<
std
::
string
>&
types
);
unsigned
int
getAttributesTypes
(
std
::
vector
<
std
::
string
>&
types
)
const
;
std
::
vector
<
AttributeMultiVector
<
MarkerBool
>*>&
getMarkerAttributes
();
...
...
@@ -468,7 +462,6 @@ public:
inline
AttributeMultiVectorGen
*
getVirtualDataVector
(
unsigned
int
attrIndex
);
/**
* get an AttributeMultiVector
* @param attribName name of the attribute
...
...
@@ -508,8 +501,6 @@ public:
template
<
typename
T
>
void
setData
(
unsigned
int
attrIndex
,
unsigned
int
eltIndex
,
const
T
&
data
);
/**************************************
* SAVE & LOAD *
**************************************/
...
...
@@ -548,19 +539,14 @@ public:
void
dumpCSV
()
const
;
void
dumpByLines
()
const
;
};
}
// namespace CGoGN
#include "attributeContainer.hpp"
#include "
Container/
attributeContainer.hpp"
#endif
///**
//* Container for AttributeMultiVectors
//* All the attributes always have the same size and
...
...
CGoGN/include/Container/attributeContainer.hpp
View file @
d11304b9
...
...
@@ -198,7 +198,7 @@ bool AttributeContainer::removeAttribute(unsigned int index)
}
template
<
typename
T
>
unsigned
int
AttributeContainer
::
getAttributeBlocksPointers
(
unsigned
int
attrIndex
,
std
::
vector
<
T
*>&
vect_ptr
,
unsigned
int
&
byteBlockSize
)
unsigned
int
AttributeContainer
::
getAttributeBlocksPointers
(
unsigned
int
attrIndex
,
std
::
vector
<
T
*>&
vect_ptr
,
unsigned
int
&
byteBlockSize
)
const
{
assert
(
attrIndex
<
m_tableAttribs
.
size
()
||
!
"getAttributeBlocksPointers: attribute index out of bounds"
);
assert
(
m_tableAttribs
[
attrIndex
]
!=
NULL
||
!
"getAttributeBlocksPointers: attribute does not exist"
);
...
...
@@ -208,7 +208,6 @@ unsigned int AttributeContainer::getAttributeBlocksPointers(unsigned int attrInd
return
atm
->
getBlocksPointers
(
vect_ptr
,
byteBlockSize
);
}
/**************************************
* INFO ABOUT THE CONTAINER *
**************************************/
...
...
@@ -316,7 +315,6 @@ inline void AttributeContainer::realNext(unsigned int &it) const
}
while
((
it
<
m_maxSize
)
&&
(
!
used
(
it
)));
}
inline
unsigned
int
AttributeContainer
::
realRBegin
()
const
{
unsigned
int
it
=
m_maxSize
-
1
;
...
...
@@ -338,9 +336,6 @@ inline void AttributeContainer::realRNext(unsigned int &it) const
}
while
((
it
!=
0xffffffff
)
&&
(
!
used
(
it
)));
}
/**************************************
* LINES MANAGEMENT *
**************************************/
...
...
@@ -362,7 +357,6 @@ inline void AttributeContainer::initMarkersOfLine(unsigned int index)
}
}
inline
void
AttributeContainer
::
copyLine
(
unsigned
int
dstIndex
,
unsigned
int
srcIndex
)
{
for
(
unsigned
int
i
=
0
;
i
<
m_tableAttribs
.
size
();
++
i
)
...
...
@@ -375,7 +369,6 @@ inline void AttributeContainer::copyLine(unsigned int dstIndex, unsigned int src
{
m_tableMarkerAttribs
[
i
]
->
copyElt
(
dstIndex
,
srcIndex
);
}
}
inline
void
AttributeContainer
::
refLine
(
unsigned
int
index
)
...
...
@@ -452,7 +445,6 @@ AttributeMultiVector<T>* AttributeContainer::getDataVector(const std::string& at
return
atm
;
}
inline
CGoGNCodeType
AttributeContainer
::
getTypeCode
(
const
std
::
string
&
attribName
)
const
{
unsigned
int
index
=
getAttributeIndex
(
attribName
)
;
...
...
@@ -461,8 +453,6 @@ inline CGoGNCodeType AttributeContainer::getTypeCode(const std::string& attribNa
return
m_tableAttribs
[
index
]
->
getTypeCode
();
}
inline
AttributeMultiVectorGen
*
AttributeContainer
::
getVirtualDataVector
(
const
std
::
string
&
attribName
)
{
unsigned
int
index
=
getAttributeIndex
(
attribName
)
;
...
...
@@ -511,12 +501,9 @@ inline void AttributeContainer::setData(unsigned int attrIndex, unsigned int elt
atm
->
operator
[](
eltIndex
)
=
data
;
}
inline
std
::
vector
<
AttributeMultiVector
<
MarkerBool
>*>&
AttributeContainer
::
getMarkerAttributes
()
{
return
m_tableMarkerAttribs
;
}
}
// namespace CGoGN
CGoGN/include/Geometry/bounding_box.hpp
View file @
d11304b9
...
...
@@ -81,7 +81,6 @@ template <typename VEC>
typename
VEC
::
DATA_TYPE
BoundingBox
<
VEC
>::
maxSize
()
const
{
assert
(
m_initialized
||
!
"Bounding box not initialized"
);
typename
VEC
::
DATA_TYPE
max
=
m_pMax
[
0
]
-
m_pMin
[
0
]
;
for
(
unsigned
int
i
=
1
;
i
<
m_pMax
.
dimension
();
++
i
)
{
...
...
@@ -96,7 +95,6 @@ template <typename VEC>
typename
VEC
::
DATA_TYPE
BoundingBox
<
VEC
>::
minSize
()
const
{
assert
(
m_initialized
||
!
"Bounding box not initialized"
);
typename
VEC
::
DATA_TYPE
min
=
m_pMax
[
0
]
-
m_pMin
[
0
]
;
for
(
unsigned
int
i
=
1
;
i
<
m_pMax
.
dimension
();
++
i
)
{
...
...
CGoGN/include/Topology/generic/genericmap.h
View file @
d11304b9
...
...
@@ -47,7 +47,6 @@
#include "Topology/dll.h"
namespace
CGoGN
{
...
...
CGoGN/src/Container/attributeContainer.cpp
View file @
d11304b9
...
...
@@ -92,7 +92,6 @@ namespace CGoGN
return
m_tableAttribs
[
index
]
->
getName
()
;
}
unsigned
int
AttributeContainer
::
getAttributesNames
(
std
::
vector
<
std
::
string
>&
names
)
const
{
names
.
clear
()
;
...
...
@@ -107,23 +106,20 @@ namespace CGoGN
return
m_nbAttributes
;
}
unsigned
int
AttributeContainer
::
getAttributesTypes
(
std
::
vector
<
std
::
string
>&
types
)
unsigned
int
AttributeContainer
::
getAttributesTypes
(
std
::
vector
<
std
::
string
>&
types
)
const
{
types
.
clear
()
;
types
.
reserve
(
m_nbAttributes
)
;
for
(
unsigned
int
i
=
0
;
i
<
m_tableAttribs
.
size
();
++
i
)
{
if
(
m_tableAttribs
[
i
]
!=
NULL
)
if
(
m_tableAttribs
[
i
]
!=
NULL
)
types
.
push_back
(
m_tableAttribs
[
i
]
->
getTypeName
())
;
}
return
m_nbAttributes
;
}
/**************************************
* CONTAINER MANAGEMENT *
**************************************/
...
...
SCHNApps/Plugins/surface_deformation/src/surface_deformation.cpp
View file @
d11304b9
...
...
@@ -35,25 +35,25 @@ void MapParameters::start(MapHandlerGen* mhg)
{
MapHandler
<
PFP2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
mhg
);
positionInit
=
mh
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
"positionInit"
,
false
);
positionInit
=
mh
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
"positionInit"
);
if
(
!
positionInit
.
isValid
())
positionInit
=
mh
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
"positionInit"
,
false
);
positionInit
=
mh
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
"positionInit"
);
diffCoord
=
mh
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
"diffCoord"
,
false
);
diffCoord
=
mh
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
"diffCoord"
);
if
(
!
diffCoord
.
isValid
())
diffCoord
=
mh
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
"diffCoord"
,
false
);
diffCoord
=
mh
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
"diffCoord"
);
vertexRotationMatrix
=
mh
->
getAttribute
<
Eigen_Matrix3f
,
VERTEX
>
(
"vertexRotationMatrix"
,
false
);
vertexRotationMatrix
=
mh
->
getAttribute
<
Eigen_Matrix3f
,
VERTEX
>
(
"vertexRotationMatrix"
);
if
(
!
vertexRotationMatrix
.
isValid
())
vertexRotationMatrix
=
mh
->
addAttribute
<
Eigen_Matrix3f
,
VERTEX
>
(
"vertexRotationMatrix"
,
false
);
vertexRotationMatrix
=
mh
->
addAttribute
<
Eigen_Matrix3f
,
VERTEX
>
(
"vertexRotationMatrix"
);
rotatedDiffCoord
=
mh
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
"rotatedDiffCoord"
,
false
);
rotatedDiffCoord
=
mh
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
"rotatedDiffCoord"
);
if
(
!
rotatedDiffCoord
.
isValid
())
rotatedDiffCoord
=
mh
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
"rotatedDiffCoord"
,
false
);
rotatedDiffCoord
=
mh
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
"rotatedDiffCoord"
);
vIndex
=
mh
->
getAttribute
<
unsigned
int
,
VERTEX
>
(
"vIndex"
,
false
);
vIndex
=
mh
->
getAttribute
<
unsigned
int
,
VERTEX
>
(
"vIndex"
);
if
(
!
vIndex
.
isValid
())
vIndex
=
mh
->
addAttribute
<
unsigned
int
,
VERTEX
>
(
"vIndex"
,
false
);
vIndex
=
mh
->
addAttribute
<
unsigned
int
,
VERTEX
>
(
"vIndex"
);
PFP2
::
MAP
*
map
=
static_cast
<
MapHandler
<
PFP2
>*>
(
mh
)
->
getMap
();
...
...
@@ -174,7 +174,6 @@ void Surface_Deformation_Plugin::keyPress(View* view, QKeyEvent* event)
{
asRigidAsPossible
(
mh
);
mh
->
notifyAttributeModification
(
p
.
positionAttribute
);
static_cast
<
MapHandler
<
PFP2
>*>
(
mh
)
->
updateBB
(
p
.
positionAttribute
);
view
->
updateGL
();
}
}
...
...
@@ -225,7 +224,6 @@ void Surface_Deformation_Plugin::mouseMove(View* view, QMouseEvent* event)
{
asRigidAsPossible
(
mh
);
mh
->
notifyAttributeModification
(
p
.
positionAttribute
);
static_cast
<
MapHandler
<
PFP2
>*>
(
mh
)
->
updateBB
(
p
.
positionAttribute
);
}
}
...
...
SCHNApps/Plugins/surface_differentialProperties/include/surface_differentialProperties.h
View file @
d11304b9
...
...
@@ -38,7 +38,7 @@ private slots:
void
computeNormalFromDialog
();
void
computeCurvatureFromDialog
();
void
appsFinished
();
void
schnappsClosing
();
public
slots
:
void
computeNormal
(
const
QString
&
mapName
,
...
...
SCHNApps/Plugins/surface_differentialProperties/src/surface_differentialProperties.cpp
View file @
d11304b9
...
...
@@ -37,7 +37,7 @@ bool Surface_DifferentialProperties_Plugin::enable()
connect
(
m_schnapps
,
SIGNAL
(
mapAdded
(
MapHandlerGen
*
)),
this
,
SLOT
(
mapAdded
(
MapHandlerGen
*
)));
connect
(
m_schnapps
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
mapRemoved
(
MapHandlerGen
*
)));
connect
(
m_schnapps
,
SIGNAL
(
appsFinished
()),
this
,
SLOT
(
appsFinished
()));
connect
(
m_schnapps
,
SIGNAL
(
schnappsClosing
()),
this
,
SLOT
(
schnappsClosing
()));
foreach
(
MapHandlerGen
*
map
,
m_schnapps
->
getMapSet
().
values
())
...
...
@@ -60,7 +60,7 @@ void Surface_DifferentialProperties_Plugin::disable()
disconnect
(
m_schnapps
,
SIGNAL
(
mapAdded
(
MapHandlerGen
*
)),
this
,
SLOT
(
mapAdded
(
MapHandlerGen
*
)));
disconnect
(
m_schnapps
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
mapRemoved
(
MapHandlerGen
*
)));
disconnect
(
m_schnapps
,
SIGNAL
(
appsFinished
()),
this
,
SLOT
(
appsFinished
()));
disconnect
(
m_schnapps
,
SIGNAL
(
schnappsClosing
()),
this
,
SLOT
(
schnappsClosing
()));
}
void
Surface_DifferentialProperties_Plugin
::
mapAdded
(
MapHandlerGen
*
map
)
...
...
@@ -309,7 +309,7 @@ void Surface_DifferentialProperties_Plugin::computeCurvature(
}
}
void
Surface_DifferentialProperties_Plugin
::
appsFinished
()
void
Surface_DifferentialProperties_Plugin
::
schnappsClosing
()
{
m_computeNormalDialog
->
close
();
m_computeCurvatureDialog
->
close
();
...
...
SCHNApps/Plugins/surface_distance/include/surface_distance.h
View file @
d11304b9
...
...
@@ -30,7 +30,7 @@ private slots:
void
openComputeDistanceDialog
();
void
computeDistanceFromDialog
();
void
appsFinished
();
void
schnappsClosing
();
public
slots
:
void
computeDistance
(
...
...
SCHNApps/Plugins/surface_distance/src/dialog_computeDistance.cpp
View file @
d11304b9
...
...
@@ -28,8 +28,8 @@ Dialog_ComputeDistance::Dialog_ComputeDistance(SCHNApps* s) :
foreach
(
MapHandlerGen
*
map
,
m_schnapps
->
getMapSet
().
values
())
{
QListWidgetItem
*
item1
=
new
QListWidgetItem
(
map
->
getName
(),
list_maps_1
);
QListWidgetItem
*
item2
=
new
QListWidgetItem
(
map
->
getName
(),
list_maps_2
);
list_maps_1
->
addItem
(
map
->
getName
()
);
list_maps_2
->
addItem
(
map
->
getName
()
);
}
}
...
...
@@ -109,8 +109,8 @@ void Dialog_ComputeDistance::selectedMap2Changed()
void
Dialog_ComputeDistance
::
addMapToList
(
MapHandlerGen
*
map
)
{
QListWidgetItem
*
item1
=
new
QListWidgetItem
(
map
->
getName
(),
list_maps_1
);
QListWidgetItem
*
item2
=
new
QListWidgetItem
(
map
->
getName
(),
list_maps_2
);
list_maps_1
->
addItem
(
map
->
getName
()
);
list_maps_2
->
addItem
(
map
->
getName
()
);
}
void
Dialog_ComputeDistance
::
removeMapFromList
(
MapHandlerGen
*
map
)
...
...
SCHNApps/Plugins/surface_distance/src/surface_distance.cpp
View file @
d11304b9
...
...
@@ -26,7 +26,7 @@ bool Surface_Distance_Plugin::enable()
connect
(
m_computeDistanceDialog
,
SIGNAL
(
accepted
()),
this
,
SLOT
(
computeDistanceFromDialog
()));
connect
(
m_computeDistanceDialog
->
button_apply
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
computeDistanceFromDialog
()));
connect
(
m_schnapps
,
SIGNAL
(
appsFinished
()),
this
,
SLOT
(
appsFinished
()));
connect
(
m_schnapps
,
SIGNAL
(
schnappsClosing
()),
this
,
SLOT
(
schnappsClosing
()));
return
true
;
}
...
...
@@ -38,7 +38,7 @@ void Surface_Distance_Plugin::disable()
disconnect
(
m_computeDistanceDialog
,
SIGNAL
(
accepted
()),
this
,
SLOT
(
computeDistanceFromDialog
()));
disconnect
(
m_computeDistanceDialog
->
button_apply
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
computeDistanceFromDialog
()));
disconnect
(
m_schnapps
,
SIGNAL
(
appsFinished
()),
this
,
SLOT
(
appsFinished
()));
disconnect
(
m_schnapps
,
SIGNAL
(
schnappsClosing
()),
this
,
SLOT
(
schnappsClosing
()));
}
void
Surface_Distance_Plugin
::
openComputeDistanceDialog
()
...
...
@@ -133,7 +133,7 @@ void Surface_Distance_Plugin::computeDistance(
mh2
->
notifyAttributeModification
(
distance2
);
}
void
Surface_Distance_Plugin
::
appsFinished
()
void
Surface_Distance_Plugin
::
schnappsClosing
()
{
m_computeDistanceDialog
->
close
();
}
...
...
SCHNApps/Plugins/surface_import/src/surface_import.cpp
View file @
d11304b9
...
...
@@ -39,15 +39,13 @@ MapHandlerGen* Surface_Import_Plugin::importFromFile(const QString& fileName)
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Surface
::
Import
::
importMesh
<
PFP2
>
(
*
map
,
fileName
.
toStdString
(),
attrNames
);
// get vertex position attribute
VertexAttribute
<
PFP2
::
VEC3
,
PFP2
::
MAP
>
position
=
map
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
,
PFP2
::
MAP
>
(
attrNames
[
0
]);
mh
->
registerAttribute
(
position
);
// update corresponding VBO & emit attribute update signal
mh
->
notifyAttributeModification
(
position
);
// compute map bounding box
mh
->
updateBB
(
position
);
AttributeContainer
&
cont
=
map
->
getAttributeContainer
<
VERTEX
>
();
std
::
vector
<
std
::
string
>
names
;
std
::
vector
<
std
::
string
>
types
;
cont
.
getAttributesNames
(
names
);
cont
.
getAttributesTypes
(
types
);
for
(
unsigned
int
i
=
0
;
i
<
names
.
size
();
++
i
)
mhg
->
registerAttribute
(
VERTEX
,
QString
::
fromStdString
(
names
[
i
]),
QString
::
fromStdString
(
types
[
i
]));
}
return
mhg
;
}
...
...
SCHNApps/Plugins/surface_modelisation/src/surface_modelisation.cpp
View file @
d11304b9
...
...
@@ -251,8 +251,7 @@ void Surface_Modelisation_Plugin::createNewFace(MapHandlerGen* mhg)
}
mh
->
notifyConnectivityModification
();
mh
->
notifyAttributeModification
(
position
);
mh
->
updateBB
(
position
);
mh
->
notifyAttributeModification
(
position
);
collectedVertices
.
clear
();
}
else
QMessageBox
::
information
(
0
,
"Attention"
,
"To create a face you need at least 3 vertices"
);
...
...
@@ -271,9 +270,7 @@ void Surface_Modelisation_Plugin::addCube(MapHandlerGen *mhg)
Algo
::
Surface
::
Modelisation
::
embedPrism
<
PFP2
>
(
*
map
,
position
,
4
,
true
,
0.7
f
,
0.7
f
,
1.0
f
);
mh
->
notifyAttributeModification
(
position
);
mh
->
notifyConnectivityModification
();
// compute map bounding box
mh
->
updateBB
(
position
);
mh
->
notifyConnectivityModification
();
}
}
...
...
@@ -417,8 +414,7 @@ void Surface_Modelisation_Plugin::extrudeRegion(MapHandlerGen *mhg)
Algo
::
Surface
::
Modelisation
::
extrudeRegion
<
PFP2
>
(
*
map
,
p
.
positionAttribute
,
selectedDarts
[
0
],
p
.
faceSelector
->
getMarker
());
mh
->
notifyConnectivityModification
();
mh
->
notifyAttributeModification
(
p
.
positionAttribute
);
mh
->
updateBB
(
p
.
positionAttribute
);
mh
->
notifyAttributeModification
(
p
.
positionAttribute
);
}
}
...
...
@@ -739,8 +735,7 @@ void Surface_Modelisation_Plugin::extrudeFace(MapHandlerGen *mhg)
Algo
::
Surface
::
Modelisation
::
extrudeFace
<
PFP2
>
(
*
map
,
p
.
positionAttribute
,
d
,
dist
);
mh
->
notifyConnectivityModification
();
mh
->
notifyAttributeModification
(
p
.
positionAttribute
);
mh
->
updateBB
(
p
.
positionAttribute
);
mh
->
notifyAttributeModification
(
p
.
positionAttribute
);
}
}
...
...
@@ -790,13 +785,11 @@ void Surface_Modelisation_Plugin::pathExtrudeFace(MapHandlerGen *mhg)
}
mh
->
notifyConnectivityModification
();
mh
->
notifyAttributeModification
(
position
);
mh
->
updateBB
(
position
);
mh
->
notifyAttributeModification
(
position
);
collectedVertices
.
clear
();
}
}
Q_EXPORT_PLUGIN2
(
Surface_Modelisation_Plugin
,
Surface_Modelisation_Plugin
)
}
// namespace SCHNApps
...
...
SCHNApps/Plugins/surface_radiance/src/surface_radiance.cpp
View file @
d11304b9
...
...
@@ -217,9 +217,6 @@ MapHandlerGen* Surface_Radiance_Plugin::importFromFile(const QString& fileName)
VertexAttribute
<
PFP2
::
VEC3
,
PFP2
::
MAP
>
position
=
map
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
,
PFP2
::
MAP
>
(
"position"
)
;
VertexAttribute
<
PFP2
::
VEC3
,
PFP2
::
MAP
>
normal
=
map
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
,
PFP2
::
MAP
>
(
"normal"
);
mh
->
registerAttribute
(
position
);
mh
->
registerAttribute
(
normal
);
// update corresponding VBO & emit attribute update signal
mh
->
notifyAttributeModification
(
position
);
mh
->
notifyAttributeModification
(
normal
);
...
...
@@ -271,9 +268,6 @@ MapHandlerGen* Surface_Radiance_Plugin::importFromFile(const QString& fileName)
mapParams
.
radiancePerVertexShader
=
new
Utils
::
ShaderRadiancePerVertex
(
Utils
::
SphericalHarmonics
<
PFP2
::
REAL
,
PFP2
::
VEC3
>::
get_resolution
());
registerShader
(
mapParams
.
radiancePerVertexShader
);
// compute map bounding box
mh
->
updateBB
(
position
);
}
return
mhg
;
}
...
...
SCHNApps/Plugins/surface_render/include/surface_render.h
View file @
d11304b9
...
...
@@ -95,7 +95,7 @@ private slots:
void
vboAdded
(
Utils
::
VBO
*
vbo
);
void
vboRemoved
(
Utils
::
VBO
*
vbo
);
void
appsFinished
();
void
schnappsClosing
();
public
slots
:
// slots for Python calls
...
...
SCHNApps/Plugins/surface_render/src/surface_render.cpp
View file @
d11304b9
...
...
@@ -12,7 +12,7 @@ namespace SCHNApps
bool
Surface_Render_Plugin
::
enable
()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap
::
copyAllStatics
(
m_schnapps
->
getStaticPointers
());
GenericMap
::
copyAllStatics
(
m_schnapps
->
getStaticPointers
());
m_dockTab
=
new
Surface_Render_DockTab
(
m_schnapps
,
this
);
m_schnapps
->
addPluginDockTab
(
this
,
m_dockTab
,
"Surface_Render"
);
...
...
@@ -41,7 +41,7 @@ bool Surface_Render_Plugin::enable()
connect
(
m_schnapps
,
SIGNAL
(
selectedMapChanged
(
MapHandlerGen
*
,
MapHandlerGen
*
)),
this
,
SLOT
(
selectedMapChanged
(
MapHandlerGen
*
,
MapHandlerGen
*
)));
connect
(
m_schnapps
,
SIGNAL
(
mapAdded
(
MapHandlerGen
*
)),
this
,
SLOT
(
mapAdded
(
MapHandlerGen
*
)));
connect
(
m_schnapps
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
mapRemoved
(
MapHandlerGen
*
)));
connect
(
m_schnapps
,
SIGNAL
(
appsFinished
()),
this
,
SLOT
(
appsFinished
()));
connect
(
m_schnapps
,
SIGNAL
(
schnappsClosing
()),
this
,
SLOT
(
schnappsClosing
()));
foreach
(
MapHandlerGen
*
map
,
m_schnapps
->
getMapSet
().
values
())
mapAdded
(
map
);
...
...
@@ -62,7 +62,7 @@ void Surface_Render_Plugin::disable()
disconnect
(
m_schnapps
,
SIGNAL
(
selectedMapChanged
(
MapHandlerGen
*
,
MapHandlerGen
*
)),
this
,
SLOT
(
selectedMapChanged
(
MapHandlerGen
*
,
MapHandlerGen
*
)));
disconnect
(
m_schnapps
,
SIGNAL
(
mapAdded
(
MapHandlerGen
*
)),
this
,
SLOT
(
mapAdded
(
MapHandlerGen
*
)));
disconnect
(
m_schnapps
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
mapRemoved
(
MapHandlerGen
*
)));
disconnect
(
m_schnapps
,
SIGNAL
(
appsFinished
()),
this
,
SLOT
(
appsFinished
()));
disconnect
(
m_schnapps
,
SIGNAL
(
schnappsClosing
()),
this
,
SLOT
(
schnappsClosing
()));
foreach
(
MapHandlerGen
*
map
,
m_schnapps
->
getMapSet
().
values
())
mapRemoved
(
map
);
...
...
@@ -108,8 +108,6 @@ void Surface_Render_Plugin::drawMap(View* view, MapHandlerGen* map)
if
(
p
.
renderEdges
)
{
glLineWidth
(
1.0
f
);
CGoGN
::
Geom
::
Vec4f
c
(
0.1
f
,
0.1
f
,
0.1
f
,
1.0
f
);
m_simpleColorShader
->
setColor
(
c
);
m_simpleColorShader
->
setAttributePosition
(
p
.
positionVBO
);
m_simpleColorShader
->
setColor
(
p
.
simpleColor
);
map
->
draw
(
m_simpleColorShader
,
CGoGN
::
Algo
::
Render
::
GL2
::
LINES
);
...
...
@@ -140,10 +138,6 @@ void Surface_Render_Plugin::selectedMapChanged(MapHandlerGen *prev, MapHandlerGe
{
DEBUG_SLOT
();
m_dockTab
->
updateMapParameters
();
if
(
cur
==
NULL
)
m_dockTab
->
setDisabled
(
true
);
else
m_dockTab
->
setDisabled
(
false
);
}
void
Surface_Render_Plugin
::
mapAdded
(
MapHandlerGen
*
map
)
...
...
@@ -401,7 +395,7 @@ void Surface_Render_Plugin::changeVertexColor(const QString& view, const QString
void
Surface_Render_Plugin
::
appsFinished
()
void
Surface_Render_Plugin
::
schnappsClosing
()
{
m_dockTab
->
m_colorDial
->
close
();
}
...
...
SCHNApps/Plugins/surface_render/src/surface_render_dockTab.cpp
View file @
d11304b9
...
...
@@ -72,7 +72,7 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
View
*
view
=
m_schnapps
->
getSelectedView
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
if
(
view
&&
map
)
if
(
view
&&
map
)
{
m_plugin
->
h_viewParameterSet
[
view
][
map
].
diffuseColor
=
rgbCol
;
view
->
updateGL
();
...
...
@@ -89,7 +89,7 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
View
*
view
=
m_schnapps
->
getSelectedView
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
if
(
view
&&
map
)
if
(
view
&&
map
)
{
m_plugin
->
h_viewParameterSet
[
view
][
map
].
simpleColor
=
rgbCol
;
view
->
updateGL
();
...
...
@@ -106,7 +106,7 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
View
*
view
=
m_schnapps
->
getSelectedView
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
if
(
view
&&
map
)
if
(
view
&&
map
)
{
m_plugin
->
h_viewParameterSet
[
view
][
map
].
vertexColor
=
rgbCol
;
view
->
updateGL
();
...
...
@@ -120,11 +120,11 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
void
Surface_Render_DockTab
::
positionVBOChanged
(
int
index
)
{
if
(
!
b_updatingUI
)
if
(
!
b_updatingUI
)
{
View
*
view
=
m_schnapps
->
getSelectedView
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
if
(
view
&&
map
)
if
(
view
&&
map
)
{
m_plugin
->
h_viewParameterSet
[
view
][
map
].
positionVBO
=
map
->
getVBO
(
combo_positionVBO
->
currentText
());
view
->
updateGL
();
...
...
@@ -134,11 +134,11 @@ void Surface_Render_DockTab::positionVBOChanged(int index)
void
Surface_Render_DockTab
::
normalVBOChanged
(
int
index
)
{
if
(
!
b_updatingUI
)
if
(
!
b_updatingUI
)
{
View
*
view
=
m_schnapps
->
getSelectedView
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
if
(
view
&&
map
)
if
(
view
&&
map
)