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
David Cazier
CGoGN
Commits
6d1a2ce6
Commit
6d1a2ce6
authored
Jul 16, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'schnapps_update' into 'develop'
Schnapps update See merge request !2
parents
208dd6f9
fd256f83
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
381 additions
and
88 deletions
+381
-88
.gitignore
.gitignore
+2
-1
SCHNApps/Plugins/surface_import/src/surface_import.cpp
SCHNApps/Plugins/surface_import/src/surface_import.cpp
+5
-7
SCHNApps/Plugins/surface_selection/forms/surface_selection.ui
...Apps/Plugins/surface_selection/forms/surface_selection.ui
+80
-51
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
+10
-11
SCHNApps/Plugins/surface_selection/src/surface_selection_dockTab.cpp
...ugins/surface_selection/src/surface_selection_dockTab.cpp
+43
-0
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+25
-6
SCHNApps/include/mapHandler.hpp
SCHNApps/include/mapHandler.hpp
+26
-1
SCHNApps/include/plugin.h
SCHNApps/include/plugin.h
+14
-2
SCHNApps/include/schnapps.h
SCHNApps/include/schnapps.h
+26
-1
SCHNApps/src/controlDock_mapTab.cpp
SCHNApps/src/controlDock_mapTab.cpp
+22
-0
SCHNApps/src/mapHandler.cpp
SCHNApps/src/mapHandler.cpp
+50
-0
SCHNApps/src/schnapps.cpp
SCHNApps/src/schnapps.cpp
+78
-8
No files found.
.gitignore
View file @
6d1a2ce6
...
...
@@ -2,4 +2,5 @@
CMakeLists.txt.user
bin/
ThirdParty/bin/
SCHNApps/bin
\ No newline at end of file
SCHNApps/bin/
windows_dependencies/
SCHNApps/Plugins/surface_import/src/surface_import.cpp
View file @
6d1a2ce6
...
...
@@ -38,16 +38,14 @@ MapHandlerGen* Surface_Import_Plugin::importMeshFromFile(const QString& nameOfFi
QFileInfo
fi
(
fileName
);
if
(
fi
.
exists
())
{
pythonRecording
(
"importMeshFromFile"
,
fi
.
baseName
(),
fileName
);
MapHandlerGen
*
mhg
=
m_schnapps
->
addMap
(
fi
.
baseName
(),
2
);
MapHandlerGen
*
mhg
=
m_schnapps
->
addMap
(
SCHNApps
::
forceASCII
(
fi
.
baseName
()),
2
);
if
(
mhg
)
{
MapHandler
<
PFP2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
mhg
);
PFP2
::
MAP
*
map
=
mh
->
getMap
();
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Surface
::
Import
::
importMesh
<
PFP2
>
(
*
map
,
fileName
.
to
StdString
(),
attrNames
);
Algo
::
Surface
::
Import
::
importMesh
<
PFP2
>
(
*
map
,
SCHNApps
::
nice
StdString
(
fileName
),
attrNames
);
for
(
unsigned
int
orbit
=
VERTEX
;
orbit
<=
VOLUME
;
orbit
++
)
{
...
...
@@ -60,6 +58,7 @@ MapHandlerGen* Surface_Import_Plugin::importMeshFromFile(const QString& nameOfFi
mhg
->
registerAttribute
(
orbit
,
QString
::
fromStdString
(
names
[
i
]),
QString
::
fromStdString
(
types
[
i
]));
}
}
pythonRecording
(
"importMeshFromFile"
,
mhg
->
getName
(),
fileName
);
return
mhg
;
}
else
...
...
@@ -84,9 +83,7 @@ MapHandlerGen* Surface_Import_Plugin::importImageFromFile(const QString& nameOfF
QFileInfo
fi
(
fileName
);
if
(
fi
.
exists
())
{
pythonRecording
(
"importImageFromFile"
,
fi
.
baseName
(),
fileName
);
MapHandlerGen
*
mhg
=
m_schnapps
->
addMap
(
fi
.
baseName
(),
2
);
MapHandlerGen
*
mhg
=
m_schnapps
->
addMap
(
SCHNApps
::
forceASCII
(
fi
.
baseName
()),
2
);
if
(
mhg
)
{
MapHandler
<
PFP2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
mhg
);
...
...
@@ -123,6 +120,7 @@ MapHandlerGen* Surface_Import_Plugin::importImageFromFile(const QString& nameOfF
mh
->
registerAttribute
(
color
);
}
pythonRecording
(
"importImageFromFile"
,
mhg
->
getName
(),
fileName
);
return
mhg
;
}
else
...
...
SCHNApps/Plugins/surface_selection/forms/surface_selection.ui
View file @
6d1a2ce6
...
...
@@ -14,10 +14,30 @@
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"5"
column=
"0"
colspan=
"2"
>
<widget
class=
"QPushButton"
name=
"button_clear"
>
<item
row=
"9"
column=
"0"
colspan=
"2"
>
<widget
class=
"QSlider"
name=
"slider_verticesScaleFactor"
>
<property
name=
"value"
>
<number>
50
</number>
</property>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"tickPosition"
>
<enum>
QSlider::NoTicks
</enum>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
colspan=
"2"
>
<widget
class=
"Line"
name=
"line"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Clear current selection
</string>
<string>
Normal :
</string>
</property>
</widget>
</item>
...
...
@@ -30,10 +50,10 @@
</item>
</widget>
</item>
<item
row=
"
1
"
column=
"0"
>
<widget
class=
"Q
Label"
name=
"label
"
>
<item
row=
"
6
"
column=
"0"
colspan=
"2"
>
<widget
class=
"Q
PushButton"
name=
"button_clear
"
>
<property
name=
"text"
>
<string>
Normal :
</string>
<string>
Clear current selection
</string>
</property>
</widget>
</item>
...
...
@@ -62,40 +82,6 @@
</item>
</widget>
</item>
<item
row=
"2"
column=
"0"
colspan=
"2"
>
<widget
class=
"Line"
name=
"line"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
<item
row=
"8"
column=
"0"
colspan=
"2"
>
<widget
class=
"QSlider"
name=
"slider_verticesScaleFactor"
>
<property
name=
"value"
>
<number>
50
</number>
</property>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"tickPosition"
>
<enum>
QSlider::NoTicks
</enum>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Position :
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
colspan=
"2"
>
<widget
class=
"Line"
name=
"line_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"combo_positionAttribute"
>
<property
name=
"sizePolicy"
>
...
...
@@ -111,10 +97,10 @@
</item>
</widget>
</item>
<item
row=
"
7
"
column=
"0"
colspan=
"2"
>
<widget
class=
"
QLabel
"
name=
"l
abel_4
"
>
<property
name=
"
text
"
>
<
string>
Selected vertice size
</string
>
<item
row=
"
5
"
column=
"0"
colspan=
"2"
>
<widget
class=
"
Line
"
name=
"l
ine_2
"
>
<property
name=
"
orientation
"
>
<
enum>
Qt::Horizontal
</enum
>
</property>
</widget>
</item>
...
...
@@ -125,14 +111,35 @@
</property>
</widget>
</item>
<item
row=
"9"
column=
"0"
colspan=
"2"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Position :
</string>
</property>
</widget>
</item>
<item
row=
"8"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"text"
>
<string>
Selected vertice size
</string>
</property>
</widget>
</item>
<item
row=
"10"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label_5"
>
<property
name=
"text"
>
<string>
Selected vertices color
</string>
</property>
</widget>
</item>
<item
row=
"14"
column=
"1"
>
<item
row=
"7"
column=
"0"
colspan=
"2"
>
<widget
class=
"Line"
name=
"line_3"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
<item
row=
"15"
column=
"1"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
...
...
@@ -145,13 +152,35 @@
</property>
</spacer>
</item>
<item
row=
"1
0
"
column=
"0"
colspan=
"2"
>
<item
row=
"1
1
"
column=
"0"
colspan=
"2"
>
<widget
class=
"ColorComboBox"
name=
"combo_color"
/>
</item>
<item
row=
"6"
column=
"0"
colspan=
"2"
>
<widget
class=
"Line"
name=
"line_3"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
<item
row=
"4"
column=
"1"
>
<widget
class=
"QDoubleSpinBox"
name=
"spin_angle_radius"
>
<property
name=
"toolTip"
>
<string/>
</property>
<property
name=
"statusTip"
>
<string/>
</property>
<property
name=
"whatsThis"
>
<string/>
</property>
<property
name=
"readOnly"
>
<bool>
true
</bool>
</property>
<property
name=
"buttonSymbols"
>
<enum>
QAbstractSpinBox::NoButtons
</enum>
</property>
<property
name=
"maximum"
>
<double>
999999999.000000000000000
</double>
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_angle_radius"
>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
...
...
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
View file @
6d1a2ce6
...
...
@@ -24,7 +24,7 @@ Surface_Selection_Plugin::Surface_Selection_Plugin() :
m_selectedFaces_dirty
(
false
),
m_selectionRadiusBase
(
1
),
m_selectionRadiusCoeff
(
1
),
m_normalAngleThreshold
(
10
)
m_normalAngleThreshold
(
float
(
10
*
M_PI
/
180
)
)
{}
bool
Surface_Selection_Plugin
::
enable
()
...
...
@@ -89,8 +89,11 @@ void Surface_Selection_Plugin::disable()
delete
m_selectionSphereVBO
;
disconnect
(
m_schnapps
,
SIGNAL
(
selectedViewChanged
(
View
*
,
View
*
)),
this
,
SLOT
(
selectedViewChanged
(
View
*
,
View
*
)));
disconnect
(
m_schnapps
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
mapRemoved
(
MapHandlerGen
*
)));
//disconnect(m_schnapps, SIGNAL(selectedViewChanged(View*, View*)), this, SLOT(selectedViewChanged(View*, View*)));
//disconnect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*)));
disconnect
(
m_schnapps
,
SIGNAL
(
selectedMapChanged
(
MapHandlerGen
*
,
MapHandlerGen
*
)),
this
,
SLOT
(
selectedMapChanged
(
MapHandlerGen
*
,
MapHandlerGen
*
)));
disconnect
(
m_schnapps
,
SIGNAL
(
selectedCellSelectorChanged
(
CellSelectorGen
*
)),
this
,
SLOT
(
updateSelectedCellsRendering
()));
}
void
Surface_Selection_Plugin
::
drawMap
(
View
*
view
,
MapHandlerGen
*
map
)
...
...
@@ -115,13 +118,11 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
{
if
(
m_selectedVertices_dirty
)
updateSelectedCellsRendering
();
m_pointSprite
->
setAttributePosition
(
m_selectedVerticesVBO
);
const
QColor
&
col
=
p
.
color
;
m_pointSprite
->
setColor
(
Geom
::
Vec4f
(
col
.
redF
(),
col
.
greenF
(),
col
.
blueF
(),
0.0
f
));
m_pointSprite
->
setLightPosition
(
CGoGN
::
Geom
::
Vec3f
(
0.0
f
,
0.0
f
,
1.0
f
));
m_pointSprite
->
setSize
(
p
.
basePSradius
*
p
.
verticesScaleFactor
);
m_pointSprite
->
enableVertexAttribs
();
glDrawArrays
(
GL_POINTS
,
0
,
selector
->
getNbSelectedCells
());
m_pointSprite
->
disableVertexAttribs
();
...
...
@@ -132,11 +133,9 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
std
::
vector
<
PFP2
::
VEC3
>
selectionPoint
;
selectionPoint
.
push_back
(
p
.
positionAttribute
[
m_selectingVertex
]);
m_selectionSphereVBO
->
updateData
(
selectionPoint
);
m_pointSprite
->
setAttributePosition
(
m_selectionSphereVBO
);
m_pointSprite
->
setColor
(
CGoGN
::
Geom
::
Vec4f
(
0.0
f
,
0.0
f
,
1.0
f
,
0.5
f
));
m_pointSprite
->
setLightPosition
(
CGoGN
::
Geom
::
Vec3f
(
0.0
f
,
0.0
f
,
1.0
f
));
switch
(
p
.
selectionMethod
)
{
case
NormalAngle
:
...
...
@@ -147,7 +146,6 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
m_pointSprite
->
setSize
(
m_selectionRadiusBase
*
m_selectionRadiusCoeff
);
break
;
}
m_pointSprite
->
enableVertexAttribs
();
glEnable
(
GL_BLEND
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
...
...
@@ -502,14 +500,16 @@ void Surface_Selection_Plugin::wheelEvent(View* view, QWheelEvent* event)
else
m_selectionRadiusCoeff
*=
1.1
f
;
view
->
updateGL
();
m_dockTab
->
spin_angle_radius
->
setValue
(
m_selectionRadiusBase
*
m_selectionRadiusCoeff
);
break
;
}
case
NormalAngle
:
{
if
(
event
->
delta
()
>
0
)
m_normalAngleThreshold
*
=
0.9
f
;
m_normalAngleThreshold
-
=
CGoGN
::
PFP_SCHNAPPS
::
REAL
(
M_PI
/
180
)
;
else
m_normalAngleThreshold
*
=
1.1
f
;
m_normalAngleThreshold
+
=
CGoGN
::
PFP_SCHNAPPS
::
REAL
(
M_PI
/
180
)
;
// view->displayMessage(QString("Angle threshold : ") + m_normalAngleThreshold);
m_dockTab
->
spin_angle_radius
->
setValue
(
m_normalAngleThreshold
/
M_PI
*
180
);
break
;
}
}
...
...
@@ -573,7 +573,6 @@ void Surface_Selection_Plugin::updateSelectedCellsRendering()
m_selectedEdgesDrawer
->
newList
(
GL_COMPILE
);
m_selectedEdgesDrawer
->
lineWidth
(
3.0
f
);
// m_selectedEdgesDrawer->color3f(1.0f, 0.0f, 0.0f);
m_selectedEdgesDrawer
->
color3f
(
p
.
color
.
redF
(),
p
.
color
.
greenF
(),
p
.
color
.
blueF
());
m_selectedEdgesDrawer
->
begin
(
GL_LINES
);
for
(
std
::
vector
<
Edge
>::
const_iterator
e
=
selectedCells
.
begin
();
e
!=
selectedCells
.
end
();
++
e
)
...
...
SCHNApps/Plugins/surface_selection/src/surface_selection_dockTab.cpp
View file @
6d1a2ce6
...
...
@@ -43,6 +43,7 @@ void Surface_Selection_DockTab::positionAttributeChanged(int index)
{
MapHandler
<
PFP2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
map
);
m_plugin
->
h_parameterSet
[
map
].
positionAttribute
=
mh
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
combo_positionAttribute
->
currentText
());
m_plugin
->
updateSelectedCellsRendering
();
m_plugin
->
pythonRecording
(
"changePositionAttribute"
,
""
,
map
->
getName
(),
combo_positionAttribute
->
currentText
());
}
}
...
...
@@ -57,6 +58,7 @@ void Surface_Selection_DockTab::normalAttributeChanged(int index)
{
MapHandler
<
PFP2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
map
);
m_plugin
->
h_parameterSet
[
map
].
normalAttribute
=
mh
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
combo_normalAttribute
->
currentText
());
m_plugin
->
updateSelectedCellsRendering
();
m_plugin
->
pythonRecording
(
"changeNormalAttribute"
,
""
,
map
->
getName
(),
combo_normalAttribute
->
currentText
());
}
}
...
...
@@ -72,6 +74,26 @@ void Surface_Selection_DockTab::selectionMethodChanged(int index)
m_plugin
->
h_parameterSet
[
map
].
selectionMethod
=
SelectionMethod
(
index
);
m_plugin
->
pythonRecording
(
"changeSelectionMethod"
,
""
,
map
->
getName
(),
index
);
}
switch
(
index
)
{
case
0
:
this
->
spin_angle_radius
->
setHidden
(
true
);
this
->
label_angle_radius
->
setText
(
QString
());
break
;
case
1
:
this
->
spin_angle_radius
->
setHidden
(
false
);
this
->
spin_angle_radius
->
setValue
(
m_plugin
->
m_selectionRadiusBase
*
m_plugin
->
m_selectionRadiusCoeff
);
this
->
label_angle_radius
->
setText
(
QString
(
"Radius:"
));
break
;
case
2
:
this
->
spin_angle_radius
->
setHidden
(
false
);
this
->
spin_angle_radius
->
setValue
(
m_plugin
->
m_normalAngleThreshold
/
M_PI
*
180
);
this
->
label_angle_radius
->
setText
(
QString
(
"Angle:"
));
break
;
default:
break
;
}
}
}
...
...
@@ -204,6 +226,27 @@ void Surface_Selection_DockTab::updateMapParameters()
combo_color
->
setColor
(
p
.
color
);
slider_verticesScaleFactor
->
setValue
(
int
(
50.0
*
p
.
verticesScaleFactor
));
switch
(
p
.
selectionMethod
)
{
case
0
:
this
->
spin_angle_radius
->
setHidden
(
true
);
this
->
label_angle_radius
->
setText
(
QString
());
break
;
case
1
:
this
->
spin_angle_radius
->
setHidden
(
false
);
this
->
spin_angle_radius
->
setValue
(
m_plugin
->
m_selectionRadiusBase
*
m_plugin
->
m_selectionRadiusCoeff
);
this
->
label_angle_radius
->
setText
(
QString
(
"Radius:"
));
break
;
case
2
:
this
->
spin_angle_radius
->
setHidden
(
false
);
this
->
spin_angle_radius
->
setValue
(
m_plugin
->
m_normalAngleThreshold
/
M_PI
*
180
);
this
->
label_angle_radius
->
setText
(
QString
(
"Angle:"
));
break
;
default:
break
;
}
}
b_updatingUI
=
false
;
...
...
SCHNApps/include/mapHandler.h
View file @
6d1a2ce6
...
...
@@ -106,6 +106,12 @@ public slots:
*/
bool
isBBshown
()
const
;
/**
* @brief [PYTHON] set color for drawing BB the bounding-box
* @param color color name (red,green,...) or color format #rrggbb
*/
void
setBBColor
(
const
QString
&
color
);
/**
* @brief [PYTHON] choose the vertex attribute used to compute the bounding-box
* @param name name of attribute
...
...
@@ -347,7 +353,23 @@ public slots:
* @param sz scaling z factor
*/
void
setScaling
(
float
sx
,
float
sy
,
float
sz
);
/**
* @brief [PYTHON] Save the frame into a string
* @return the storage string
*/
QString
frameToString
();
/**
* @brief [PYTHON] restore frame from string storage
* @param frame the string with frame info
*/
void
frameFromString
(
QString
frame
);
/**
* @brief reset the frame manipulator to its initial position
*/
void
frameReset
();
/*********************************************************
* SIGNALS
...
...
@@ -385,6 +407,7 @@ protected:
AttributeMultiVectorGen
*
m_bbVertexAttribute
;
float
m_bbDiagSize
;
Utils
::
Drawer
*
m_bbDrawer
;
glm
::
vec3
m_bbColor
;
Algo
::
Render
::
GL2
::
MapRender
*
m_render
;
Algo
::
Render
::
GL2
::
TopoRender
*
m_topoRender
;
...
...
@@ -409,11 +432,7 @@ public:
MapHandlerGen
(
name
,
s
,
map
)
{}
~
MapHandler
()
{
if
(
m_map
)
delete
m_map
;
}
~
MapHandler
();
inline
MAP
*
getMap
()
{
return
static_cast
<
MAP
*>
(
m_map
);
}
...
...
SCHNApps/include/mapHandler.hpp
View file @
6d1a2ce6
...
...
@@ -9,6 +9,8 @@ namespace CGoGN
namespace
SCHNApps
{
inline
void
MapHandlerGen
::
registerAttribute
(
const
AttributeHandlerGen
&
ah
)
{
m_attribs
[
ah
.
getOrbit
()].
insert
(
QString
::
fromStdString
(
ah
.
name
()),
QString
::
fromStdString
(
ah
.
typeName
()));
...
...
@@ -31,6 +33,29 @@ inline QString MapHandlerGen::getAttributeTypeName(unsigned int orbit, const QSt
template
<
typename
PFP
>
MapHandler
<
PFP
>::~
MapHandler
()
{
// clean the cell selector
for
(
unsigned
int
orbit
=
0
;
orbit
<
NB_ORBITS
;
++
orbit
)
{
foreach
(
CellSelectorGen
*
cs
,
m_cellSelectors
[
orbit
])
{
if
(
cs
)
{
emit
(
cellSelectorRemoved
(
orbit
,
cs
->
getName
()));
disconnect
(
cs
,
SIGNAL
(
selectedCellsChanged
()),
this
,
SLOT
(
selectedCellsChanged
()));
delete
cs
;
}
}
m_cellSelectors
[
orbit
].
clear
();
}
if
(
m_map
)
delete
m_map
;
}
template
<
typename
PFP
>
unsigned
int
MapHandler
<
PFP
>::
getNbDarts
()
{
...
...
@@ -132,7 +157,7 @@ void MapHandler<PFP>::updateBBDrawer()
bbmax
+=
Geom
::
Vec3f
(
shift
,
shift
,
shift
);
m_bbDrawer
->
newList
(
GL_COMPILE
);
m_bbDrawer
->
color3f
(
0.0
f
,
1.0
f
,
0.0
f
);
m_bbDrawer
->
color3f
(
m_bbColor
[
0
],
m_bbColor
[
1
],
m_bbColor
[
2
]
);
m_bbDrawer
->
lineWidth
(
2.0
f
);
// m_bbDrawer->lineWidth(shift);
m_bbDrawer
->
begin
(
GL_LINE_LOOP
);
...
...
SCHNApps/include/plugin.h
View file @
6d1a2ce6
...
...
@@ -89,9 +89,21 @@ inline T pyR_stringify(T v)
template
<
>
inline
QString
pyR_stringify
(
QString
v
)
{
return
"
\"
"
+
v
+
"
\"
"
;
}
// test if v containe non ascii char
bool
needDecode
=
false
;
int
i
=
0
;
while
(
!
needDecode
&&
(
i
<
v
.
size
()))
{
if
(
v
[
i
].
unicode
()
>
127
)
needDecode
=
true
;
++
i
;
}
if
(
needDecode
)
return
"
\"
"
+
v
+
"
\"
.decode('latin-1')"
;
else
return
"
\"
"
+
v
+
"
\"
"
;
}
template
<
typename
T1
>
...
...
SCHNApps/include/schnapps.h
View file @
6d1a2ce6
...
...
@@ -316,10 +316,29 @@ public slots:
void
showHidePluginDock
();
void
showHidePythonDock
();
/**
* @brief [PYTHON] set if control dock is floating or docked
* @param 1: floating / 0: docked
*/
void
setFloatingControlDock
(
bool
f
);
/**
* @brief [PYTHON] set if plugin dock is floating or docked
* @param 1: floating / 0: docked
*/
void
setFloatingPluginDock
(
bool
f
);
/**
* @brief [PYTHON] set if python dock is floating or docked
* @param 1: floating / 0: docked
*/
void
setFloatingPythonDock
(
bool
f
);
/**
* @brief [PYTHON] Load a python script store in a file.
* @param fileName the filename with absolute path or relative to path set with setPythonPath
*
#
return true if reading file ok
*
@
return true if reading file ok
*/
bool
loadPythonScriptFromFile
(
const
QString
&
fileName
);
...
...
@@ -396,6 +415,12 @@ public:
/// replace \ by / in file path for window
static
QString
noBackSlash
(
const
QString
&
name
);
/// transform QString in std::string with
static
std
::
string
niceStdString
(
const
QString
&
qstr
);
/// force QString contain to be ascii (non ascii char are replaced by '_')
static
QString
forceASCII
(
const
QString
&
qstr
);
signals:
void
cameraAdded
(
Camera
*
camera
);
...
...
SCHNApps/src/controlDock_mapTab.cpp
View file @
6d1a2ce6
...
...
@@ -324,9 +324,31 @@ void ControlDock_MapTab::mapRemoved(MapHandlerGen* m)
if
(
!
items
.
empty
())
{
b_updatingUI
=
true
;
delete
items
[
0
];
if
(
m_schnapps
->
getSelectedMap
()
==
m
)
{
std
::
cout
<<
"Unselecting"
<<
std
::
endl
;
m_selectedSelector
[
DART
]
=
NULL
;
foreach
(
QListWidgetItem
*
item
,
list_dartSelectors
->
selectedItems
())
item
->
setSelected
(
false
);
m_selectedSelector
[
VERTEX
]
=
NULL
;
foreach
(
QListWidgetItem
*
item
,
list_vertexSelectors
->
selectedItems
())
item
->
setSelected
(
false
);
m_selectedSelector
[
EDGE
]
=
NULL
;
foreach
(
QListWidgetItem
*
item
,
list_edgeSelectors
->
selectedItems
())
item
->
setSelected
(
false
);
m_selectedSelector
[
FACE
]
=
NULL
;
foreach
(
QListWidgetItem
*
item
,
list_faceSelectors
->
selectedItems
())
item
->
setSelected
(
false
);
m_selectedSelector
[
VOLUME
]
=
NULL
;
foreach
(
QListWidgetItem
*
item
,
list_volumeSelectors
->
selectedItems
())
item
->
setSelected
(
false
);
}
b_updatingUI
=
false
;
}
}
...
...
SCHNApps/src/mapHandler.cpp
View file @
6d1a2ce6
...
...
@@ -16,6 +16,7 @@ MapHandlerGen::MapHandlerGen(const QString& name, SCHNApps* s, GenericMap* map)
m_transfoMatrixInv
(
1.0
f
),
m_bbVertexAttribute
(
NULL
),
m_bbDrawer
(
NULL
),
m_bbColor
(
0
,
1
,
0
),
m_render
(
NULL
),
m_topoRender
(
NULL
)
{
...
...
@@ -108,6 +109,16 @@ bool MapHandlerGen::isBBshown() const
return
m_showBB
;
}