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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
ab764478
Commit
ab764478
authored
Sep 02, 2013
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new plugin : surface subdivision
parent
353f07b8
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
414 additions
and
112 deletions
+414
-112
SCHNApps/Plugins/CMakeLists.txt
SCHNApps/Plugins/CMakeLists.txt
+1
-0
SCHNApps/Plugins/surface_differentialProperties/include/dialog_computeNormal.h
...ace_differentialProperties/include/dialog_computeNormal.h
+2
-2
SCHNApps/Plugins/surface_differentialProperties/src/dialog_computeNormal.cpp
...rface_differentialProperties/src/dialog_computeNormal.cpp
+5
-6
SCHNApps/Plugins/surface_renderVector/src/surface_renderVector_dockTab.cpp
...surface_renderVector/src/surface_renderVector_dockTab.cpp
+1
-1
SCHNApps/Plugins/surface_subdivision/CMakeLists.txt
SCHNApps/Plugins/surface_subdivision/CMakeLists.txt
+4
-4
SCHNApps/Plugins/surface_subdivision/forms/dialog_surface_subdivision.ui
...s/surface_subdivision/forms/dialog_surface_subdivision.ui
+83
-0
SCHNApps/Plugins/surface_subdivision/forms/subdivideSurfaceDialog.ui
...ugins/surface_subdivision/forms/subdivideSurfaceDialog.ui
+0
-95
SCHNApps/Plugins/surface_subdivision/include/dialog_surface_subdivision.h
.../surface_subdivision/include/dialog_surface_subdivision.h
+37
-0
SCHNApps/Plugins/surface_subdivision/include/surface_subdivision.h
...Plugins/surface_subdivision/include/surface_subdivision.h
+57
-0
SCHNApps/Plugins/surface_subdivision/src/dialog_surface_subdivision.cpp
...ns/surface_subdivision/src/dialog_surface_subdivision.cpp
+93
-0
SCHNApps/Plugins/surface_subdivision/src/surface_subdivision.cpp
...s/Plugins/surface_subdivision/src/surface_subdivision.cpp
+125
-0
include/Algo/Modelisation/subdivision.h
include/Algo/Modelisation/subdivision.h
+2
-2
include/Algo/Modelisation/subdivision.hpp
include/Algo/Modelisation/subdivision.hpp
+4
-2
No files found.
SCHNApps/Plugins/CMakeLists.txt
View file @
ab764478
...
@@ -4,3 +4,4 @@ ADD_SUBDIRECTORY(surface_import)
...
@@ -4,3 +4,4 @@ ADD_SUBDIRECTORY(surface_import)
ADD_SUBDIRECTORY
(
surface_render
)
ADD_SUBDIRECTORY
(
surface_render
)
ADD_SUBDIRECTORY
(
surface_renderVector
)
ADD_SUBDIRECTORY
(
surface_renderVector
)
ADD_SUBDIRECTORY
(
surface_differentialProperties
)
ADD_SUBDIRECTORY
(
surface_differentialProperties
)
ADD_SUBDIRECTORY
(
surface_subdivision
)
SCHNApps/Plugins/surface_differentialProperties/include/dialog_computeNormal.h
View file @
ab764478
...
@@ -25,8 +25,8 @@ private:
...
@@ -25,8 +25,8 @@ private:
public
slots
:
public
slots
:
void
selectedMapChanged
();
void
selectedMapChanged
();
void
addMapToList
(
MapHandlerGen
*
m
);
void
addMapToList
(
MapHandlerGen
*
m
ap
);
void
removeMapFromList
(
MapHandlerGen
*
m
);
void
removeMapFromList
(
MapHandlerGen
*
m
ap
);
void
addAttributeToList
(
unsigned
int
orbit
,
const
QString
&
nameAttr
);
void
addAttributeToList
(
unsigned
int
orbit
,
const
QString
&
nameAttr
);
};
};
...
...
SCHNApps/Plugins/surface_differentialProperties/src/dialog_computeNormal.cpp
View file @
ab764478
...
@@ -54,7 +54,6 @@ void Dialog_ComputeNormal::selectedMapChanged()
...
@@ -54,7 +54,6 @@ void Dialog_ComputeNormal::selectedMapChanged()
{
{
combo_positionAttribute
->
addItem
(
i
.
key
());
combo_positionAttribute
->
addItem
(
i
.
key
());
combo_normalAttribute
->
addItem
(
i
.
key
());
combo_normalAttribute
->
addItem
(
i
.
key
());
++
j
;
++
j
;
}
}
}
}
...
@@ -66,19 +65,19 @@ void Dialog_ComputeNormal::selectedMapChanged()
...
@@ -66,19 +65,19 @@ void Dialog_ComputeNormal::selectedMapChanged()
m_selectedMap
=
NULL
;
m_selectedMap
=
NULL
;
}
}
void
Dialog_ComputeNormal
::
addMapToList
(
MapHandlerGen
*
m
)
void
Dialog_ComputeNormal
::
addMapToList
(
MapHandlerGen
*
m
ap
)
{
{
QListWidgetItem
*
item
=
new
QListWidgetItem
(
m
->
getName
(),
list_maps
);
QListWidgetItem
*
item
=
new
QListWidgetItem
(
m
ap
->
getName
(),
list_maps
);
item
->
setCheckState
(
Qt
::
Unchecked
);
item
->
setCheckState
(
Qt
::
Unchecked
);
}
}
void
Dialog_ComputeNormal
::
removeMapFromList
(
MapHandlerGen
*
m
)
void
Dialog_ComputeNormal
::
removeMapFromList
(
MapHandlerGen
*
m
ap
)
{
{
QList
<
QListWidgetItem
*>
items
=
list_maps
->
findItems
(
m
->
getName
(),
Qt
::
MatchExactly
);
QList
<
QListWidgetItem
*>
items
=
list_maps
->
findItems
(
m
ap
->
getName
(),
Qt
::
MatchExactly
);
if
(
!
items
.
empty
())
if
(
!
items
.
empty
())
delete
items
[
0
];
delete
items
[
0
];
if
(
m_selectedMap
==
m
)
if
(
m_selectedMap
==
m
ap
)
{
{
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
addAttributeToList
(
unsigned
int
,
const
QString
&
)));
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
addAttributeToList
(
unsigned
int
,
const
QString
&
)));
m_selectedMap
=
NULL
;
m_selectedMap
=
NULL
;
...
...
SCHNApps/Plugins/surface_renderVector/src/surface_renderVector_dockTab.cpp
View file @
ab764478
...
@@ -125,7 +125,7 @@ void Surface_RenderVector_DockTab::updateMapParameters()
...
@@ -125,7 +125,7 @@ void Surface_RenderVector_DockTab::updateMapParameters()
{
{
const
MapParameters
&
p
=
m_plugin
->
h_viewParameterSet
[
view
][
map
];
const
MapParameters
&
p
=
m_plugin
->
h_viewParameterSet
[
view
][
map
];
unsigned
int
i
=
0
;
unsigned
int
i
=
1
;
foreach
(
Utils
::
VBO
*
vbo
,
map
->
getVBOSet
().
values
())
foreach
(
Utils
::
VBO
*
vbo
,
map
->
getVBOSet
().
values
())
{
{
if
(
vbo
->
dataSize
()
==
3
)
if
(
vbo
->
dataSize
()
==
3
)
...
...
SCHNApps/Plugins/surface_subdivision/CMakeLists.txt
View file @
ab764478
cmake_minimum_required
(
VERSION 2.8
)
cmake_minimum_required
(
VERSION 2.8
)
SET
(
PLUGIN_NAME Su
bdivideSurface
)
SET
(
PLUGIN_NAME Su
rface_Subdivision
)
SET
(
PLUGIN_ROOT_DIR
${
SCHNApps_ROOT_DIR
}
/Plugins/su
bdivideSurface
)
SET
(
PLUGIN_ROOT_DIR
${
SCHNApps_ROOT_DIR
}
/Plugins/su
rface_subdivision
)
INCLUDE_DIRECTORIES
(
INCLUDE_DIRECTORIES
(
${
PLUGIN_ROOT_DIR
}
/include
${
PLUGIN_ROOT_DIR
}
/include
...
@@ -25,8 +25,8 @@ file(
...
@@ -25,8 +25,8 @@ file(
SET
(
SET
(
PLUGIN_QOBJECT_FILES
PLUGIN_QOBJECT_FILES
${
PLUGIN_ROOT_DIR
}
/include/su
bdivideSurface
.h
${
PLUGIN_ROOT_DIR
}
/include/su
rface_subdivision
.h
${
PLUGIN_ROOT_DIR
}
/include/
subdivideSurfaceDialog
.h
${
PLUGIN_ROOT_DIR
}
/include/
dialog_surface_subdivision
.h
)
)
include
(
${
SCHNApps_ROOT_DIR
}
/Plugins/plugins_cmake.txt
)
include
(
${
SCHNApps_ROOT_DIR
}
/Plugins/plugins_cmake.txt
)
SCHNApps/Plugins/surface_subdivision/forms/dialog_surface_subdivision.ui
0 → 100644
View file @
ab764478
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
Dialog_Surface_Subdivision
</class>
<widget
class=
"QDialog"
name=
"Dialog_Surface_Subdivision"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
314
</width>
<height>
230
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Subdivide surface
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"0"
column=
"0"
colspan=
"5"
>
<widget
class=
"QListWidget"
name=
"list_maps"
/>
</item>
<item
row=
"1"
column=
"0"
colspan=
"3"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Position attribute :
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"3"
colspan=
"2"
>
<widget
class=
"QComboBox"
name=
"combo_positionAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QRadioButton"
name=
"radio_Loop"
>
<property
name=
"text"
>
<string>
Loop
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
colspan=
"3"
>
<widget
class=
"QRadioButton"
name=
"radio_CC"
>
<property
name=
"text"
>
<string>
Catmull-Clark
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"4"
>
<widget
class=
"QRadioButton"
name=
"radio_trianguleFaces"
>
<property
name=
"text"
>
<string>
Triangule faces
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"0"
colspan=
"2"
>
<widget
class=
"QPushButton"
name=
"button_cancel"
>
<property
name=
"text"
>
<string>
Cancel
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"2"
colspan=
"2"
>
<widget
class=
"QPushButton"
name=
"button_apply"
>
<property
name=
"text"
>
<string>
Apply
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"4"
>
<widget
class=
"QPushButton"
name=
"button_ok"
>
<property
name=
"text"
>
<string>
OK
</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
SCHNApps/Plugins/surface_subdivision/forms/subdivideSurfaceDialog.ui
deleted
100644 → 0
View file @
353f07b8
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
SubdivideSurfaceDialog
</class>
<widget
class=
"QDialog"
name=
"SubdivideSurfaceDialog"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
314
</width>
<height>
230
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Subdivide surface
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QListWidget"
name=
"mapList"
/>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_2"
>
<item>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Position attribute :
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QComboBox"
name=
"combo_positionAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<widget
class=
"QRadioButton"
name=
"radio_Loop"
>
<property
name=
"text"
>
<string>
Loop
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QRadioButton"
name=
"radio_CC"
>
<property
name=
"text"
>
<string>
Catmull-Clark
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QRadioButton"
name=
"radio_trianguleFaces"
>
<property
name=
"text"
>
<string>
Triangule faces
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_3"
>
<item>
<widget
class=
"QPushButton"
name=
"button_cancel"
>
<property
name=
"text"
>
<string>
Cancel
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"button_apply"
>
<property
name=
"text"
>
<string>
Apply
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"button_ok"
>
<property
name=
"text"
>
<string>
OK
</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
SCHNApps/Plugins/surface_subdivision/include/
subdivideSurfaceDialog
.h
→
SCHNApps/Plugins/surface_subdivision/include/
dialog_surface_subdivision
.h
View file @
ab764478
#ifndef _
SUBDIVIDESURFACE_DIALOG
_H_
#ifndef _
DIALOG_SURFACE_SUBDIVISION
_H_
#define _
SUBDIVIDESURFACE_DIALOG
_H_
#define _
DIALOG_SURFACE_SUBDIVISION
_H_
#include "ui_
subdivideSurfaceDialog
.h"
#include "ui_
dialog_surface_subdivision
.h"
namespace
CGoGN
namespace
CGoGN
{
{
...
@@ -9,25 +9,25 @@ namespace CGoGN
...
@@ -9,25 +9,25 @@ namespace CGoGN
namespace
SCHNApps
namespace
SCHNApps
{
{
class
Window
;
class
SCHNApps
;
class
MapHandlerGen
;
class
MapHandlerGen
;
class
SubdivideSurfaceDialog
:
public
QDialog
,
public
Ui
::
SubdivideSurfaceDialog
class
Dialog_Surface_Subdivision
:
public
QDialog
,
public
Ui
::
Dialog_Surface_Subdivision
{
{
Q_OBJECT
Q_OBJECT
public:
public:
SubdivideSurfaceDialog
(
Window
*
w
);
Dialog_Surface_Subdivision
(
SCHNApps
*
s
);
private:
private:
Window
*
m_window
;
SCHNApps
*
m_schnapps
;
MapHandlerGen
*
m_selectedMap
;
MapHandlerGen
*
m_selectedMap
;
public
slots
:
public
slots
:
void
selectedMapChanged
();
void
selectedMapChanged
();
void
addMapToList
(
MapHandlerGen
*
m
);
void
addMapToList
(
MapHandlerGen
*
m
ap
);
void
removeMapFromList
(
MapHandlerGen
*
m
);
void
removeMapFromList
(
MapHandlerGen
*
m
ap
);
void
addAttributeToList
(
unsigned
int
orbit
,
const
QString
&
name
);
void
addAttributeToList
(
unsigned
int
orbit
,
const
QString
&
name
Attr
);
};
};
}
// namespace SCHNApps
}
// namespace SCHNApps
...
...
SCHNApps/Plugins/surface_subdivision/include/su
bdivideSurface
.h
→
SCHNApps/Plugins/surface_subdivision/include/su
rface_subdivision
.h
View file @
ab764478
#ifndef _SU
BDIVIDESURFACE
_PLUGIN_H_
#ifndef _SU
RFACE_SUBDIVISION
_PLUGIN_H_
#define _SU
BDIVIDESURFACE
_PLUGIN_H_
#define _SU
RFACE_SUBDIVISION
_PLUGIN_H_
#include "plugin.h"
#include "plugin_processing.h"
#include "subdivideSurfaceDialog.h"
#include "dialog_surface_subdivision.h"
namespace
CGoGN
namespace
CGoGN
{
{
...
@@ -10,36 +11,26 @@ namespace CGoGN
...
@@ -10,36 +11,26 @@ namespace CGoGN
namespace
SCHNApps
namespace
SCHNApps
{
{
class
Su
bdivideSurface
Plugin
:
public
Plugin
class
Su
rface_Subdivision_
Plugin
:
public
Plugin
{
{
Q_OBJECT
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
public:
public:
SubdivideSurfacePlugin
()
Surface_Subdivision_Plugin
()
{
{}
setProvidesRendering
(
false
);
}
~
Su
bdivideSurface
Plugin
()
~
Su
rface_Subdivision_
Plugin
()
{}
{}
virtual
bool
enable
();
virtual
bool
enable
();
virtual
void
disable
()
{}
virtual
void
disable
()
{}
virtual
void
redraw
(
View
*
view
)
{}
private
slots
:
void
openSubdivisionDialog
();
virtual
void
keyPress
(
View
*
view
,
QKeyEvent
*
event
)
{}
void
subdivideFromDialog
();
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
)
{}
public
slots
:
public
slots
:
void
openSubdivideSurfaceDialog
();
void
subdivideSurfaceFromDialog
();
void
loopSubdivision
(
void
loopSubdivision
(
const
QString
&
mapName
,
const
QString
&
mapName
,
const
QString
&
positionAttributeName
=
"position"
const
QString
&
positionAttributeName
=
"position"
...
@@ -54,9 +45,9 @@ public slots:
...
@@ -54,9 +45,9 @@ public slots:
);
);
private:
private:
SubdivideSurfaceDialog
*
m_subdivideSurface
Dialog
;
Dialog_Surface_Subdivision
*
m_subdivision
Dialog
;
QAction
*
m_subdivi
deSurface
Action
;
QAction
*
m_subdivi
sion
Action
;
};
};
}
// namespace SCHNApps
}
// namespace SCHNApps
...
...
SCHNApps/Plugins/surface_subdivision/src/
subdivideSurfaceDialog
.cpp
→
SCHNApps/Plugins/surface_subdivision/src/
dialog_surface_subdivision
.cpp
View file @
ab764478
#include "
subdivideSurfaceDialog
.h"
#include "
dialog_surface_subdivision
.h"
#include "su
bdivideSurface
.h"
#include "su
rface_subdivision
.h"
#include "
window
.h"
#include "
schnapps
.h"
#include "mapHandler.h"
#include "mapHandler.h"
namespace
CGoGN
namespace
CGoGN
...
@@ -10,47 +10,43 @@ namespace CGoGN
...
@@ -10,47 +10,43 @@ namespace CGoGN
namespace
SCHNApps
namespace
SCHNApps
{
{
SubdivideSurfaceDialog
::
SubdivideSurfaceDialog
(
Window
*
w
)
:
Dialog_Surface_Subdivision
::
Dialog_Surface_Subdivision
(
SCHNApps
*
s
)
:
m_
window
(
w
),
m_
schnapps
(
s
),
m_selectedMap
(
NULL
)
m_selectedMap
(
NULL
)
{
{
setupUi
(
this
);
setupUi
(
this
);
connect
(
m_
window
,
SIGNAL
(
mapAdded
(
MapHandlerGen
*
)),
this
,
SLOT
(
addMapToList
(
MapHandlerGen
*
)));
connect
(
m_
schnapps
,
SIGNAL
(
mapAdded
(
MapHandlerGen
*
)),
this
,
SLOT
(
addMapToList
(
MapHandlerGen
*
)));
connect
(
m_
window
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
removeMapFromList
(
MapHandlerGen
*
)));
connect
(
m_
schnapps
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
removeMapFromList
(
MapHandlerGen
*
)));
connect
(
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
selectedMapChanged
()));
connect
(
list_maps
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
selectedMapChanged
()));
const
QList
<
MapHandlerGen
*>&
maps
=
m_window
->
getMapsList
();
foreach
(
MapHandlerGen
*
map
,
m_schnapps
->
getMapSet
().
values
())
foreach
(
MapHandlerGen
*
map
,
maps
)
list_maps
->
addItem
(
map
->
getName
());
mapList
->
addItem
(
map
->
getName
());
}
}
void
SubdivideSurfaceDialog
::
selectedMapChanged
()
void
Dialog_Surface_Subdivision
::
selectedMapChanged
()
{
{
if
(
m_selectedMap
)
if
(
m_selectedMap
)
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
addAttributeToList
(
unsigned
int
,
const
QString
&
)));
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
addAttributeToList
(
unsigned
int
,
const
QString
&
)));
QList
<
QListWidgetItem
*>
currentItems
=
mapList
->
selectedItems
();
QList
<
QListWidgetItem
*>
currentItems
=
list_maps
->
selectedItems
();
if
(
!
currentItems
.
empty
())
if
(
!
currentItems
.
empty
())
{
{
combo_positionAttribute
->
clear
();
combo_positionAttribute
->
clear
();
const
QString
&
mapname
=
currentItems
[
0
]
->
text
();
const
QString
&
mapname
=
currentItems
[
0
]
->
text
();
MapHandlerGen
*
mh
=
m_
window
->
getMap
(
mapname
);
MapHandlerGen
*
mh
=
m_
schnapps
->
getMap
(
mapname
);
QString
vec3TypeName
=
QString
::
fromStdString
(
nameOfType
(
PFP2
::
VEC3
()));
QString
vec3TypeName
=
QString
::
fromStdString
(
nameOfType
(
PFP2
::
VEC3
()));
unsigned
int
j
=
0
;
unsigned
int
j
=
0
;
const
Attribute
Hash
&
attribs
=
mh
->
getAttributesLis
t
(
VERTEX
);
const
Attribute
Set
&
attribs
=
mh
->
getAttributeSe
t
(
VERTEX
);
for
(
Attribute
Hash
::
const_iterator
i
=
attribs
.
constBegin
();
i
!=
attribs
.
constEnd
();
++
i
)
for
(
Attribute
Set
::
const_iterator
i
=
attribs
.
constBegin
();
i
!=
attribs
.
constEnd
();
++
i
)
{
{
if
(
i
.
value
()
==
vec3TypeName
)
if
(
i
.
value
()
==
vec3TypeName
)
{
{
combo_positionAttribute
->
addItem
(
i
.
key
());
combo_positionAttribute
->
addItem
(
i
.
key
());
if
(
i
.
key
()
==
"position"
)
// try to select a position attribute named "position"
combo_positionAttribute
->
setCurrentIndex
(
j
);
++
j
;
++
j
;
}
}
}
}
...
@@ -62,25 +58,25 @@ void SubdivideSurfaceDialog::selectedMapChanged()
...
@@ -62,25 +58,25 @@ void SubdivideSurfaceDialog::selectedMapChanged()
m_selectedMap
=
NULL
;
m_selectedMap
=
NULL
;
}
}
void
SubdivideSurfaceDialog
::
addMapToList
(
MapHandlerGen
*
m
)
void
Dialog_Surface_Subdivision
::
addMapToList
(
MapHandlerGen
*
map
)
{
{
mapList
->
addItem
(
m
->
getName
());
list_maps
->
addItem
(
map
->
getName
());
}
}
void
SubdivideSurfaceDialog
::
removeMapFromList
(
MapHandlerGen
*
m
)
void
Dialog_Surface_Subdivision
::
removeMapFromList
(
MapHandlerGen
*
map
)
{
{
QList
<
QListWidgetItem
*>
items
=
mapList
->
findItems
(
m
->
getName
(),
Qt
::
MatchExactly
);
QList
<
QListWidgetItem
*>
items
=
list_maps
->
findItems
(
map
->
getName
(),
Qt
::
MatchExactly
);
if
(
!
items
.
empty
())
if
(
!
items
.
empty
())
delete
items
[
0
];
delete
items
[
0
];
if
(
m_selectedMap
==
m
)
if
(
m_selectedMap
==
m
ap
)
{
{
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
addAttributeToList
(
unsigned
int
,
const
QString
&
)));
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
addAttributeToList
(
unsigned
int
,
const
QString
&
)));
m_selectedMap
=
NULL
;
m_selectedMap
=
NULL
;
}
}
}
}
void
SubdivideSurfaceDialog
::
addAttributeToList
(
unsigned
int
orbit
,
const
QString
&
nameAttr
)
void
Dialog_Surface_Subdivision
::
addAttributeToList
(
unsigned
int
orbit
,
const
QString
&
nameAttr
)
{
{
QString
vec3TypeName
=
QString
::
fromStdString
(
nameOfType
(
PFP2
::
VEC3
()));
QString
vec3TypeName
=
QString
::
fromStdString
(
nameOfType
(
PFP2
::
VEC3
()));
...
...
SCHNApps/Plugins/surface_subdivision/src/su
bdivideSurface
.cpp
→
SCHNApps/Plugins/surface_subdivision/src/su
rface_subdivision
.cpp
View file @
ab764478
#include "su
bdivideSurface
.h"
#include "su
rface_subdivision
.h"
#include "mapHandler.h"
#include "mapHandler.h"
...
@@ -10,49 +10,49 @@ namespace CGoGN
...
@@ -10,49 +10,49 @@ namespace CGoGN
namespace
SCHNApps
namespace
SCHNApps
{
{
bool
Su
bdivideSurface
Plugin
::
enable
()
bool
Su
rface_Subdivision_
Plugin
::
enable
()
{