mirror of https://github.com/CGAL/cgal
Merge remote-tracking branch 'cgal/5.1.x-branch'
This commit is contained in:
commit
eef92fbef7
|
|
@ -77,7 +77,8 @@ namespace internal {
|
||||||
PATCH, //h and hopp belong to the patch to be remeshed
|
PATCH, //h and hopp belong to the patch to be remeshed
|
||||||
PATCH_BORDER,//h belongs to the patch, hopp is MESH
|
PATCH_BORDER,//h belongs to the patch, hopp is MESH
|
||||||
MESH, //h and hopp belong to the mesh, not the patch
|
MESH, //h and hopp belong to the mesh, not the patch
|
||||||
MESH_BORDER //h belongs to the mesh, face(hopp, pmesh) == null_face()
|
MESH_BORDER, //h belongs to the mesh, face(hopp, pmesh) == null_face()
|
||||||
|
ISOLATED_CONSTRAINT //h is constrained, and incident to faces that do not belong to a patch
|
||||||
};
|
};
|
||||||
|
|
||||||
// A property map
|
// A property map
|
||||||
|
|
@ -1466,7 +1467,8 @@ private:
|
||||||
{
|
{
|
||||||
halfedge_descriptor hopp = opposite(h, mesh_);
|
halfedge_descriptor hopp = opposite(h, mesh_);
|
||||||
if ( is_on_border(h) || is_on_patch_border(h)
|
if ( is_on_border(h) || is_on_patch_border(h)
|
||||||
|| is_on_border(hopp) || is_on_patch_border(hopp))
|
|| is_on_border(hopp) || is_on_patch_border(hopp)
|
||||||
|
|| is_an_isolated_constraint(h))
|
||||||
++nb_incident_features;
|
++nb_incident_features;
|
||||||
if (nb_incident_features > 2)
|
if (nb_incident_features > 2)
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -1532,21 +1534,45 @@ private:
|
||||||
{
|
{
|
||||||
//deal with h and hopp for borders that are sharp edges to be preserved
|
//deal with h and hopp for borders that are sharp edges to be preserved
|
||||||
halfedge_descriptor h = halfedge(e, mesh_);
|
halfedge_descriptor h = halfedge(e, mesh_);
|
||||||
if (status(h) == PATCH){
|
Halfedge_status hs = status(h);
|
||||||
|
if (hs == PATCH) {
|
||||||
set_status(h, PATCH_BORDER);
|
set_status(h, PATCH_BORDER);
|
||||||
|
hs = PATCH_BORDER;
|
||||||
has_border_ = true;
|
has_border_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
halfedge_descriptor hopp = opposite(h, mesh_);
|
halfedge_descriptor hopp = opposite(h, mesh_);
|
||||||
if (status(hopp) == PATCH){
|
Halfedge_status hsopp = status(hopp);
|
||||||
|
if (hsopp == PATCH) {
|
||||||
set_status(hopp, PATCH_BORDER);
|
set_status(hopp, PATCH_BORDER);
|
||||||
|
hsopp = PATCH_BORDER;
|
||||||
has_border_ = true;
|
has_border_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hs != PATCH_BORDER && hsopp != PATCH_BORDER)
|
||||||
|
{
|
||||||
|
set_status(h, ISOLATED_CONSTRAINT);
|
||||||
|
set_status(hopp, ISOLATED_CONSTRAINT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::ofstream ofs("dump_isolated.polylines.txt");
|
||||||
|
for (edge_descriptor e : edges(mesh_))
|
||||||
|
{
|
||||||
|
halfedge_descriptor h = halfedge(e, mesh_);
|
||||||
|
if (status(h) == ISOLATED_CONSTRAINT)
|
||||||
|
{
|
||||||
|
CGAL_assertion(status(opposite(h, mesh_)) == ISOLATED_CONSTRAINT);
|
||||||
|
ofs << "2 " << get(vpmap_, target(h, mesh_))
|
||||||
|
<< " " << get(vpmap_, source(h, mesh_)) << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ofs.close();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Halfedge_status status(const halfedge_descriptor& h) const
|
Halfedge_status status(const halfedge_descriptor& h) const
|
||||||
{
|
{
|
||||||
return get(halfedge_status_pmap_,h);
|
return get(halfedge_status_pmap_,h);
|
||||||
|
|
@ -1815,6 +1841,13 @@ public:
|
||||||
return status(h) == MESH;
|
return status(h) == MESH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_an_isolated_constraint(const halfedge_descriptor& h) const
|
||||||
|
{
|
||||||
|
bool res = (status(h) == ISOLATED_CONSTRAINT);
|
||||||
|
CGAL_assertion(!res || status(opposite(h, mesh_)) == ISOLATED_CONSTRAINT);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void halfedge_added(const halfedge_descriptor& h,
|
void halfedge_added(const halfedge_descriptor& h,
|
||||||
const Halfedge_status& s)
|
const Halfedge_status& s)
|
||||||
|
|
|
||||||
|
|
@ -10,18 +10,19 @@ Scene_group_item::Scene_group_item(QString name)
|
||||||
expanded = true;
|
expanded = true;
|
||||||
already_drawn = false;
|
already_drawn = false;
|
||||||
scene = Three::scene();
|
scene = Three::scene();
|
||||||
|
children = new QList<Scene_interface::Item_id>();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scene_group_item::isFinite() const
|
bool Scene_group_item::isFinite() const
|
||||||
{
|
{
|
||||||
Q_FOREACH(Scene_interface::Item_id id, children)
|
for(Scene_interface::Item_id id : *children)
|
||||||
if(!getChild(id)->isFinite()){ return false;
|
if(!getChild(id)->isFinite()){ return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scene_group_item::isEmpty() const {
|
bool Scene_group_item::isEmpty() const {
|
||||||
Q_FOREACH(Scene_interface::Item_id id, children)
|
for(Scene_interface::Item_id id : *children)
|
||||||
if(!getChild(id)->isEmpty()){
|
if(!getChild(id)->isEmpty()){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -31,7 +32,7 @@ bool Scene_group_item::isEmpty() const {
|
||||||
Scene_group_item::Bbox Scene_group_item::bbox() const
|
Scene_group_item::Bbox Scene_group_item::bbox() const
|
||||||
{
|
{
|
||||||
Scene_item* first_non_empty = nullptr;
|
Scene_item* first_non_empty = nullptr;
|
||||||
Q_FOREACH(Scene_interface::Item_id id, children)
|
for(Scene_interface::Item_id id : *children)
|
||||||
if(!getChild(id)->isEmpty())
|
if(!getChild(id)->isEmpty())
|
||||||
{
|
{
|
||||||
first_non_empty = getChild(id);
|
first_non_empty = getChild(id);
|
||||||
|
|
@ -40,7 +41,7 @@ Scene_group_item::Bbox Scene_group_item::bbox() const
|
||||||
if(first_non_empty)
|
if(first_non_empty)
|
||||||
{
|
{
|
||||||
Bbox b =first_non_empty->bbox();
|
Bbox b =first_non_empty->bbox();
|
||||||
Q_FOREACH(Scene_interface::Item_id id, children)
|
for(Scene_interface::Item_id id : *children)
|
||||||
b+=getChild(id)->bbox();
|
b+=getChild(id)->bbox();
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
@ -50,7 +51,7 @@ Scene_group_item::Bbox Scene_group_item::bbox() const
|
||||||
|
|
||||||
bool Scene_group_item::supportsRenderingMode(RenderingMode m) const {
|
bool Scene_group_item::supportsRenderingMode(RenderingMode m) const {
|
||||||
|
|
||||||
Q_FOREACH(Scene_interface::Item_id id, children)
|
for(Scene_interface::Item_id id : *children)
|
||||||
if(!getChild(id)->supportsRenderingMode(m))
|
if(!getChild(id)->supportsRenderingMode(m))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -59,16 +60,16 @@ bool Scene_group_item::supportsRenderingMode(RenderingMode m) const {
|
||||||
|
|
||||||
QString Scene_group_item::toolTip() const {
|
QString Scene_group_item::toolTip() const {
|
||||||
QString str =
|
QString str =
|
||||||
QObject::tr( "<p>Number of children: %1<br />").arg(children.size());
|
QObject::tr( "<p>Number of children: %1<br />").arg(children->size());
|
||||||
str+="</p>";
|
str+="</p>";
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene_group_item::addChild(Scene_item* new_item)
|
void Scene_group_item::addChild(Scene_item* new_item)
|
||||||
{
|
{
|
||||||
if(!children.contains(scene->item_id(new_item)))
|
if(!children->contains(scene->item_id(new_item)))
|
||||||
{
|
{
|
||||||
children.append(scene->item_id(new_item));
|
children->append(scene->item_id(new_item));
|
||||||
update_group_number(new_item, has_group+1);
|
update_group_number(new_item, has_group+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -76,9 +77,9 @@ void Scene_group_item::addChild(Scene_item* new_item)
|
||||||
|
|
||||||
void Scene_group_item::addChild(Scene_interface::Item_id new_id)
|
void Scene_group_item::addChild(Scene_interface::Item_id new_id)
|
||||||
{
|
{
|
||||||
if(!children.contains(new_id))
|
if(!children->contains(new_id))
|
||||||
{
|
{
|
||||||
children.append(new_id);
|
children->append(new_id);
|
||||||
update_group_number(getChild(new_id), has_group+1);
|
update_group_number(getChild(new_id), has_group+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -98,7 +99,7 @@ void Scene_group_item::update_group_number(Scene_item * new_item, int n)
|
||||||
void Scene_group_item::setColor(QColor c)
|
void Scene_group_item::setColor(QColor c)
|
||||||
{
|
{
|
||||||
Scene_item::setColor(c);
|
Scene_item::setColor(c);
|
||||||
Q_FOREACH(Scene_interface::Item_id id, children)
|
for(Scene_interface::Item_id id : *children)
|
||||||
{
|
{
|
||||||
getChild(id)->setColor(c);
|
getChild(id)->setColor(c);
|
||||||
}
|
}
|
||||||
|
|
@ -107,7 +108,7 @@ void Scene_group_item::setColor(QColor c)
|
||||||
void Scene_group_item::setRenderingMode(RenderingMode m)
|
void Scene_group_item::setRenderingMode(RenderingMode m)
|
||||||
{
|
{
|
||||||
Scene_item::setRenderingMode(m);
|
Scene_item::setRenderingMode(m);
|
||||||
Q_FOREACH(Scene_interface::Item_id id, children)
|
for(Scene_interface::Item_id id : *children)
|
||||||
{
|
{
|
||||||
Scene_item* child = getChild(id);
|
Scene_item* child = getChild(id);
|
||||||
if(child->supportsRenderingMode(m))
|
if(child->supportsRenderingMode(m))
|
||||||
|
|
@ -118,7 +119,7 @@ void Scene_group_item::setRenderingMode(RenderingMode m)
|
||||||
void Scene_group_item::setVisible(bool b)
|
void Scene_group_item::setVisible(bool b)
|
||||||
{
|
{
|
||||||
Scene_item::setVisible(b);
|
Scene_item::setVisible(b);
|
||||||
Q_FOREACH(Scene_interface::Item_id id, children)
|
for(Scene_interface::Item_id id : *children)
|
||||||
{
|
{
|
||||||
Scene_item* child = getChild(id);
|
Scene_item* child = getChild(id);
|
||||||
child->setVisible(b);
|
child->setVisible(b);
|
||||||
|
|
@ -139,12 +140,12 @@ void Scene_group_item::setExpanded(bool b)
|
||||||
|
|
||||||
void Scene_group_item::moveDown(int i)
|
void Scene_group_item::moveDown(int i)
|
||||||
{
|
{
|
||||||
children.move(i, i+1);
|
children->move(i, i+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene_group_item::moveUp(int i)
|
void Scene_group_item::moveUp(int i)
|
||||||
{
|
{
|
||||||
children.move(i, i-1);
|
children->move(i, i-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene_group_item::draw(CGAL::Three::Viewer_interface* ) const {
|
void Scene_group_item::draw(CGAL::Three::Viewer_interface* ) const {
|
||||||
|
|
@ -167,7 +168,7 @@ void Scene_group_item::renderChildren(Viewer_interface *viewer,
|
||||||
bool with_names)
|
bool with_names)
|
||||||
{
|
{
|
||||||
|
|
||||||
Q_FOREACH(Scene_interface::Item_id id, children){
|
for(Scene_interface::Item_id id : *children){
|
||||||
if(with_names) {
|
if(with_names) {
|
||||||
viewer->glClearDepthf(1.0f);
|
viewer->glClearDepthf(1.0f);
|
||||||
viewer->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
viewer->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
@ -229,14 +230,14 @@ void Scene_group_item::lockChild(Scene_item *child)
|
||||||
|
|
||||||
void Scene_group_item::lockChild(Scene_interface::Item_id id)
|
void Scene_group_item::lockChild(Scene_interface::Item_id id)
|
||||||
{
|
{
|
||||||
if(!children.contains(id))
|
if(!children->contains(id))
|
||||||
return;
|
return;
|
||||||
getChild(id)->setProperty("lock", true);
|
getChild(id)->setProperty("lock", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene_group_item::unlockChild(Scene_interface::Item_id id)
|
void Scene_group_item::unlockChild(Scene_interface::Item_id id)
|
||||||
{
|
{
|
||||||
if(!children.contains(id))
|
if(!children->contains(id))
|
||||||
return;
|
return;
|
||||||
getChild(id)->setProperty("lock", false);
|
getChild(id)->setProperty("lock", false);
|
||||||
}
|
}
|
||||||
|
|
@ -246,7 +247,7 @@ void Scene_group_item::unlockChild(Scene_item *child)
|
||||||
}
|
}
|
||||||
bool Scene_group_item::isChildLocked(Scene_interface::Item_id id)
|
bool Scene_group_item::isChildLocked(Scene_interface::Item_id id)
|
||||||
{
|
{
|
||||||
if(!children.contains(id)
|
if(!children->contains(id)
|
||||||
|| (!getChild(id)->property("lock").toBool()) )
|
|| (!getChild(id)->property("lock").toBool()) )
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -259,7 +260,7 @@ bool Scene_group_item::isChildLocked(Scene_item *child)
|
||||||
void Scene_group_item::setAlpha(int )
|
void Scene_group_item::setAlpha(int )
|
||||||
{
|
{
|
||||||
|
|
||||||
Q_FOREACH(Scene_interface::Item_id id, children)
|
for(Scene_interface::Item_id id : *children)
|
||||||
{
|
{
|
||||||
scene->item(id)->setAlpha(static_cast<int>(alpha()*255));
|
scene->item(id)->setAlpha(static_cast<int>(alpha()*255));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -628,11 +628,17 @@ if [ -f '${LIST_TEST_PACKAGES}' ]; then
|
||||||
cp '${CGAL_TEST_DIR}/makefile2' '${CGAL_BINARY_DIR}/test'
|
cp '${CGAL_TEST_DIR}/makefile2' '${CGAL_BINARY_DIR}/test'
|
||||||
cp '${CGAL_TEST_DIR}/run_testsuite_with_cmake' '${CGAL_BINARY_DIR}/test'
|
cp '${CGAL_TEST_DIR}/run_testsuite_with_cmake' '${CGAL_BINARY_DIR}/test'
|
||||||
|
|
||||||
for PACKAGE in \`source '${LIST_TEST_PACKAGES}' '${CGAL_ROOT}'\`; do
|
# list all packages in CGAL_TEST_DIR. If PACKAGE is found in LIST_TEST_PACKAGES,
|
||||||
|
# copy it, else prepare for the special "skipped" case in the table.
|
||||||
if [ -d "${CGAL_TEST_DIR}/\${PACKAGE}" ]; then
|
for PACKAGE in \$(ls "${CGAL_TEST_DIR}"); do
|
||||||
mkdir "${CGAL_BINARY_DIR}/test/\${PACKAGE}"
|
if [ -d "${CGAL_TEST_DIR}/\$PACKAGE" ]; then
|
||||||
|
if source '${LIST_TEST_PACKAGES}' '${CGAL_ROOT}' | egrep -q \$PACKAGE; then
|
||||||
|
mkdir "\${CGAL_BINARY_DIR}/test/\${PACKAGE}"
|
||||||
cp -r "${CGAL_TEST_DIR}/\${PACKAGE}" '${CGAL_BINARY_DIR}/test'
|
cp -r "${CGAL_TEST_DIR}/\${PACKAGE}" '${CGAL_BINARY_DIR}/test'
|
||||||
|
else
|
||||||
|
mkdir "${CGAL_BINARY_DIR}/test/\${PACKAGE}"
|
||||||
|
touch "${CGAL_BINARY_DIR}/test/\${PACKAGE}/skipped"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
# GENERATE_TARBALLS=[ON/OFF] indicates if release tarballs should be created as DESTINATION
|
# GENERATE_TARBALLS=[ON/OFF] indicates if release tarballs should be created as DESTINATION
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.1...3.15)
|
cmake_minimum_required(VERSION 3.1...3.15)
|
||||||
|
find_program(BASH NAMES bash sh)
|
||||||
function(process_package pkg)
|
function(process_package pkg)
|
||||||
if(VERBOSE)
|
if(VERBOSE)
|
||||||
message(STATUS "handling ${pkg}")
|
message(STATUS "handling ${pkg}")
|
||||||
|
|
@ -223,7 +223,7 @@ if (TESTSUITE)
|
||||||
if(IS_DIRECTORY "${release_dir}/test/${d}")
|
if(IS_DIRECTORY "${release_dir}/test/${d}")
|
||||||
if(NOT EXISTS "${release_dir}/test/${d}/cgal_test_with_cmake")
|
if(NOT EXISTS "${release_dir}/test/${d}/cgal_test_with_cmake")
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${GIT_REPO}/Scripts/developer_scripts/create_cgal_test_with_cmake
|
COMMAND ${BASH} ${GIT_REPO}/Scripts/developer_scripts/create_cgal_test_with_cmake
|
||||||
WORKING_DIRECTORY "${release_dir}/test/${d}"
|
WORKING_DIRECTORY "${release_dir}/test/${d}"
|
||||||
RESULT_VARIABLE RESULT_VAR
|
RESULT_VARIABLE RESULT_VAR
|
||||||
OUTPUT_VARIABLE OUT_VAR
|
OUTPUT_VARIABLE OUT_VAR
|
||||||
|
|
@ -249,7 +249,7 @@ if (TESTSUITE)
|
||||||
file(RENAME "${release_dir}/tmp/${d}" "${release_dir}/test/${d}_Demo")
|
file(RENAME "${release_dir}/tmp/${d}" "${release_dir}/test/${d}_Demo")
|
||||||
if(NOT EXISTS "${release_dir}/test/${d}_Demo/cgal_test_with_cmake")
|
if(NOT EXISTS "${release_dir}/test/${d}_Demo/cgal_test_with_cmake")
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${GIT_REPO}/Scripts/developer_scripts/create_cgal_test_with_cmake --no-run
|
COMMAND ${BASH} ${GIT_REPO}/Scripts/developer_scripts/create_cgal_test_with_cmake --no-run
|
||||||
WORKING_DIRECTORY "${release_dir}/test/${d}_Demo"
|
WORKING_DIRECTORY "${release_dir}/test/${d}_Demo"
|
||||||
RESULT_VARIABLE RESULT_VAR
|
RESULT_VARIABLE RESULT_VAR
|
||||||
OUTPUT_VARIABLE OUT_VAR
|
OUTPUT_VARIABLE OUT_VAR
|
||||||
|
|
@ -270,7 +270,7 @@ if (TESTSUITE)
|
||||||
file(RENAME "${release_dir}/tmp/${d}" "${release_dir}/test/${d}_Examples")
|
file(RENAME "${release_dir}/tmp/${d}" "${release_dir}/test/${d}_Examples")
|
||||||
if(NOT EXISTS "${release_dir}/test/${d}_Examples/cgal_test_with_cmake")
|
if(NOT EXISTS "${release_dir}/test/${d}_Examples/cgal_test_with_cmake")
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${GIT_REPO}/Scripts/developer_scripts/create_cgal_test_with_cmake
|
COMMAND ${BASH} ${GIT_REPO}/Scripts/developer_scripts/create_cgal_test_with_cmake
|
||||||
WORKING_DIRECTORY "${release_dir}/test/${d}_Examples"
|
WORKING_DIRECTORY "${release_dir}/test/${d}_Examples"
|
||||||
RESULT_VARIABLE RESULT_VAR
|
RESULT_VARIABLE RESULT_VAR
|
||||||
OUTPUT_VARIABLE OUT_VAR
|
OUTPUT_VARIABLE OUT_VAR
|
||||||
|
|
|
||||||
|
|
@ -246,7 +246,9 @@ run_testsuite()
|
||||||
esac
|
esac
|
||||||
|
|
||||||
for DIR in $TEST_DIRECTORIES ; do
|
for DIR in $TEST_DIRECTORIES ; do
|
||||||
|
if [ ! -f $DIR/skipped ]; then
|
||||||
test_directory "$DIR"
|
test_directory "$DIR"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -382,14 +382,16 @@ private:
|
||||||
minMax[3 + j] = PN[6 * i + j];
|
minMax[3 + j] = PN[6 * i + j];
|
||||||
}
|
}
|
||||||
for (std::size_t i = 0; i < 3; i++) {
|
for (std::size_t i = 0; i < 3; i++) {
|
||||||
minMax[i] *= 0.99;
|
minMax[i] = (minMax[i] > 0.)
|
||||||
minMax[3 + i] *= 1.01;
|
? (0.99 * minMax[i]) : (1.01 * minMax[i]);
|
||||||
|
minMax[3 + i] = (minMax[3+i] > 0.)
|
||||||
|
? (1.01 * minMax[3+i]) : (0.99 * minMax[3+i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::size_t i = 0; i < 3; i++)
|
for (std::size_t i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
res[i] = (std::size_t)ceil((minMax[3 + i] - minMax[i]) / cellSize);
|
res[i] = (std::size_t)ceil((minMax[3 + i] - minMax[i]) / cellSize);
|
||||||
if(res[1] == 0)
|
if(res[i] == 0)
|
||||||
res[i] = 1;
|
res[i] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class DEMO_FRAMEWORK_EXPORT Scene_group_item : public Scene_item_rendering_helpe
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public :
|
public :
|
||||||
Scene_group_item(QString name = QString("New group"));
|
Scene_group_item(QString name = QString("New group"));
|
||||||
~Scene_group_item() {}
|
~Scene_group_item() { delete children;}
|
||||||
//!Returns false to avoid disturbing the BBox of the scene.
|
//!Returns false to avoid disturbing the BBox of the scene.
|
||||||
bool isFinite() const Q_DECL_OVERRIDE;
|
bool isFinite() const Q_DECL_OVERRIDE;
|
||||||
//!Returns true to avoid disturbing the BBox of the scene.
|
//!Returns true to avoid disturbing the BBox of the scene.
|
||||||
|
|
@ -196,7 +196,7 @@ public :
|
||||||
//!
|
//!
|
||||||
//! Only returns children that have this item as a parent.
|
//! Only returns children that have this item as a parent.
|
||||||
//! Children of these children are not returned.
|
//! Children of these children are not returned.
|
||||||
QList<Scene_interface::Item_id> getChildren() const {return children;}
|
QList<Scene_interface::Item_id> getChildren() const {return *children;}
|
||||||
|
|
||||||
//! \brief getChildrenForSelection returns the list of
|
//! \brief getChildrenForSelection returns the list of
|
||||||
//! children to select along with the group.
|
//! children to select along with the group.
|
||||||
|
|
@ -205,7 +205,7 @@ public :
|
||||||
//! this function defines which of its children will be added too.
|
//! this function defines which of its children will be added too.
|
||||||
//! Typically overriden to allow applying an operation from the
|
//! Typically overriden to allow applying an operation from the
|
||||||
//! Operation menu only to the parent item and not to its children.
|
//! Operation menu only to the parent item and not to its children.
|
||||||
virtual QList<Scene_interface::Item_id> getChildrenForSelection() const {return children;}
|
virtual QList<Scene_interface::Item_id> getChildrenForSelection() const {return *children;}
|
||||||
//!Removes a Scene_item from the list of children.
|
//!Removes a Scene_item from the list of children.
|
||||||
//!@see getChildren() @see addChild()
|
//!@see getChildren() @see addChild()
|
||||||
void removeChild( Scene_item* item)
|
void removeChild( Scene_item* item)
|
||||||
|
|
@ -214,7 +214,7 @@ public :
|
||||||
return;
|
return;
|
||||||
update_group_number(item,0);
|
update_group_number(item,0);
|
||||||
item->moveToGroup(0);
|
item->moveToGroup(0);
|
||||||
children.removeOne(scene->item_id(item));
|
children->removeOne(scene->item_id(item));
|
||||||
}
|
}
|
||||||
//!Removes a Scene_item from the list of children using its index.
|
//!Removes a Scene_item from the list of children using its index.
|
||||||
//!@see getChildren() @see addChild()
|
//!@see getChildren() @see addChild()
|
||||||
|
|
@ -243,13 +243,13 @@ public Q_SLOTS:
|
||||||
//!
|
//!
|
||||||
void adjustIds(Scene_interface::Item_id removed_id)
|
void adjustIds(Scene_interface::Item_id removed_id)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < children.size(); ++i)
|
for(int i = 0; i < children->size(); ++i)
|
||||||
{
|
{
|
||||||
if(children[i] > removed_id)
|
if((*children)[i] > removed_id)
|
||||||
--children[i];
|
--(*children)[i];
|
||||||
else if(children[i] == removed_id)//child has been removed from the scene, it doesn't exist anymore.
|
else if((*children)[i] == removed_id)//child has been removed from the scene, it doesn't exist anymore.
|
||||||
{
|
{
|
||||||
children.removeAll(removed_id);
|
children->removeAll(removed_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -260,7 +260,7 @@ private:
|
||||||
protected:
|
protected:
|
||||||
Scene_interface *scene;
|
Scene_interface *scene;
|
||||||
//!Contains a reference to all the children of this group.
|
//!Contains a reference to all the children of this group.
|
||||||
QList<Scene_interface::Item_id> children;
|
QList<Scene_interface::Item_id>* children;
|
||||||
|
|
||||||
}; //end of class Scene_group_item
|
}; //end of class Scene_group_item
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,12 @@
|
||||||
|
|
||||||
#include <CGAL/license/Three.h>
|
#include <CGAL/license/Three.h>
|
||||||
|
|
||||||
|
#ifdef demo_framework_EXPORTS
|
||||||
|
# define DEMO_FRAMEWORK_EXPORT Q_DECL_EXPORT
|
||||||
|
#else
|
||||||
|
# define DEMO_FRAMEWORK_EXPORT Q_DECL_IMPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace CGAL
|
namespace CGAL
|
||||||
{
|
{
|
||||||
namespace Three {
|
namespace Three {
|
||||||
|
|
@ -22,7 +28,7 @@ namespace Three {
|
||||||
//! Base class to allow an item to copy properties from another.
|
//! Base class to allow an item to copy properties from another.
|
||||||
//! Properties reprensent the current state of an item : its color,
|
//! Properties reprensent the current state of an item : its color,
|
||||||
//! the position of its manipulated frame, ...
|
//! the position of its manipulated frame, ...
|
||||||
class Scene_item_with_properties {
|
class DEMO_FRAMEWORK_EXPORT Scene_item_with_properties {
|
||||||
public:
|
public:
|
||||||
virtual ~Scene_item_with_properties(){}
|
virtual ~Scene_item_with_properties(){}
|
||||||
//!\brief Copies properties from another Scene_item.
|
//!\brief Copies properties from another Scene_item.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue