mirror of https://github.com/CGAL/cgal
Indentation fixes
This commit is contained in:
parent
676144eb17
commit
35cb845ead
|
|
@ -27,28 +27,30 @@
|
||||||
#include <QWidgetAction>
|
#include <QWidgetAction>
|
||||||
#include <CGAL/Qt/manipulatedCameraFrame.h>
|
#include <CGAL/Qt/manipulatedCameraFrame.h>
|
||||||
|
|
||||||
#include <set>
|
|
||||||
#include <stack>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <boost/array.hpp>
|
|
||||||
|
|
||||||
#include <CGAL/boost/graph/properties_Surface_mesh.h>
|
|
||||||
|
|
||||||
#ifdef CGAL_LINKED_WITH_TBB
|
#ifdef CGAL_LINKED_WITH_TBB
|
||||||
#include <tbb/parallel_for.h>
|
#include <tbb/parallel_for.h>
|
||||||
#include <tbb/blocked_range.h>
|
#include <tbb/blocked_range.h>
|
||||||
#include <tbb/scalable_allocator.h>
|
#include <tbb/scalable_allocator.h>
|
||||||
#endif // CGAL_LINKED_WITH_TBB
|
#endif // CGAL_LINKED_WITH_TBB
|
||||||
|
|
||||||
|
#include <boost/array.hpp>
|
||||||
|
|
||||||
|
#include <set>
|
||||||
|
#include <stack>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
const std::size_t limit_fast_drawing = 300000; //arbitraty large value
|
const std::size_t limit_fast_drawing = 300000; //arbitraty large value
|
||||||
|
|
||||||
typedef CGAL::Three::Point_container Pc;
|
typedef CGAL::Three::Point_container Pc;
|
||||||
typedef CGAL::Three::Edge_container Ec;
|
typedef CGAL::Three::Edge_container Ec;
|
||||||
typedef CGAL::Three::Viewer_interface VI;
|
typedef CGAL::Three::Viewer_interface VI;
|
||||||
|
|
||||||
typedef Scene_points_with_normal_item_priv Priv;
|
typedef Scene_points_with_normal_item_priv Priv;
|
||||||
|
|
||||||
struct Scene_points_with_normal_item_priv
|
struct Scene_points_with_normal_item_priv
|
||||||
{
|
{
|
||||||
enum Point_container_id{
|
enum Point_container_id
|
||||||
|
{
|
||||||
Points = 0,
|
Points = 0,
|
||||||
Shaded_points,
|
Shaded_points,
|
||||||
Selected_points,
|
Selected_points,
|
||||||
|
|
@ -68,30 +70,28 @@ struct Scene_points_with_normal_item_priv
|
||||||
point_Slider->setMinimum(1);
|
point_Slider->setMinimum(1);
|
||||||
point_Slider->setValue(CGAL::Three::Three::getDefaultPointSize());
|
point_Slider->setValue(CGAL::Three::Three::getDefaultPointSize());
|
||||||
point_Slider->setMaximum(25);
|
point_Slider->setMaximum(25);
|
||||||
item->setPointContainer(Priv::Selected_shaded_points, new Pc(VI::PROGRAM_WITH_LIGHT,
|
item->setPointContainer(Priv::Selected_shaded_points, new Pc(VI::PROGRAM_WITH_LIGHT, false));
|
||||||
false));
|
item->setPointContainer(Priv::Selected_points, new Pc(VI::PROGRAM_NO_SELECTION, false));
|
||||||
item->setPointContainer(Priv::Selected_points, new Pc(VI::PROGRAM_NO_SELECTION,
|
item->setPointContainer(Priv::Shaded_points, new Pc(VI::PROGRAM_WITH_LIGHT, false));
|
||||||
false));
|
item->setPointContainer(Priv::Points, new Pc(VI::PROGRAM_NO_SELECTION, false));
|
||||||
item->setPointContainer(Priv::Shaded_points, new Pc(VI::PROGRAM_WITH_LIGHT,
|
item->setEdgeContainer(0, new Ec(VI::PROGRAM_NO_SELECTION, false));
|
||||||
false));
|
|
||||||
item->setPointContainer(Priv::Points, new Pc(VI::PROGRAM_NO_SELECTION,
|
|
||||||
false));
|
|
||||||
item->setEdgeContainer(0, new Ec(VI::PROGRAM_NO_SELECTION,
|
|
||||||
false));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Scene_points_with_normal_item_priv(Scene_points_with_normal_item* parent)
|
Scene_points_with_normal_item_priv(Scene_points_with_normal_item* parent)
|
||||||
: m_points(new Point_set)
|
: m_points(new Point_set)
|
||||||
{
|
{
|
||||||
init_values(parent);
|
init_values(parent);
|
||||||
}
|
}
|
||||||
Scene_points_with_normal_item_priv(const Scene_points_with_normal_item& toCopy, Scene_points_with_normal_item* parent)
|
|
||||||
|
Scene_points_with_normal_item_priv(const Scene_points_with_normal_item& toCopy,
|
||||||
|
Scene_points_with_normal_item* parent)
|
||||||
: m_points(new Point_set(*toCopy.d->m_points))
|
: m_points(new Point_set(*toCopy.d->m_points))
|
||||||
{
|
{
|
||||||
init_values(parent);
|
init_values(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
Scene_points_with_normal_item_priv(const SMesh& input_mesh, Scene_points_with_normal_item* parent)
|
Scene_points_with_normal_item_priv(const SMesh& input_mesh,
|
||||||
|
Scene_points_with_normal_item* parent)
|
||||||
: m_points(new Point_set)
|
: m_points(new Point_set)
|
||||||
{
|
{
|
||||||
init_values(parent);
|
init_values(parent);
|
||||||
|
|
@ -118,6 +118,7 @@ struct Scene_points_with_normal_item_priv
|
||||||
delete normal_Slider;
|
delete normal_Slider;
|
||||||
delete point_Slider;
|
delete point_Slider;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isPointSliderMoving() { return is_point_slider_moving; }
|
bool isPointSliderMoving() { return is_point_slider_moving; }
|
||||||
void initializeBuffers(CGAL::Three::Viewer_interface *viewer) const;
|
void initializeBuffers(CGAL::Three::Viewer_interface *viewer) const;
|
||||||
void compute_normals_and_vertices() const;
|
void compute_normals_and_vertices() const;
|
||||||
|
|
@ -143,9 +144,10 @@ struct Scene_points_with_normal_item_priv
|
||||||
Scene_points_with_normal_item* item;
|
Scene_points_with_normal_item* item;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Fill_buffers {
|
class Fill_buffers
|
||||||
|
{
|
||||||
Point_set* point_set;
|
Point_set* point_set;
|
||||||
|
|
||||||
std::vector<Point_set::Index>& indices;
|
std::vector<Point_set::Index>& indices;
|
||||||
std::vector<CGAL_data_type>& positions_lines;
|
std::vector<CGAL_data_type>& positions_lines;
|
||||||
std::vector<CGAL_data_type>& positions_normals;
|
std::vector<CGAL_data_type>& positions_normals;
|
||||||
|
|
@ -212,8 +214,6 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Scene_points_with_normal_item::Scene_points_with_normal_item()
|
Scene_points_with_normal_item::Scene_points_with_normal_item()
|
||||||
{
|
{
|
||||||
setRenderingMode(Points);
|
setRenderingMode(Points);
|
||||||
|
|
@ -224,7 +224,6 @@ Scene_points_with_normal_item::Scene_points_with_normal_item()
|
||||||
// Copy constructor
|
// Copy constructor
|
||||||
Scene_points_with_normal_item::Scene_points_with_normal_item(const Scene_points_with_normal_item& toCopy)
|
Scene_points_with_normal_item::Scene_points_with_normal_item(const Scene_points_with_normal_item& toCopy)
|
||||||
{
|
{
|
||||||
|
|
||||||
d = new Scene_points_with_normal_item_priv(toCopy, this);
|
d = new Scene_points_with_normal_item_priv(toCopy, this);
|
||||||
|
|
||||||
if (!has_normals())
|
if (!has_normals())
|
||||||
|
|
@ -232,7 +231,8 @@ Scene_points_with_normal_item::Scene_points_with_normal_item(const Scene_points_
|
||||||
setRenderingMode(Points);
|
setRenderingMode(Points);
|
||||||
is_selected = true;
|
is_selected = true;
|
||||||
}
|
}
|
||||||
else{
|
else
|
||||||
|
{
|
||||||
setRenderingMode(CGAL::Three::Three::defaultPointSetRenderingMode());
|
setRenderingMode(CGAL::Three::Three::defaultPointSetRenderingMode());
|
||||||
is_selected = true;
|
is_selected = true;
|
||||||
}
|
}
|
||||||
|
|
@ -692,7 +692,6 @@ void Scene_points_with_normal_item::drawEdges(CGAL::Three::Viewer_interface* vie
|
||||||
void Scene_points_with_normal_item::
|
void Scene_points_with_normal_item::
|
||||||
drawPoints(CGAL::Three::Viewer_interface* viewer) const
|
drawPoints(CGAL::Three::Viewer_interface* viewer) const
|
||||||
{
|
{
|
||||||
|
|
||||||
GLfloat point_size;
|
GLfloat point_size;
|
||||||
viewer->glGetFloatv(GL_POINT_SIZE, &point_size);
|
viewer->glGetFloatv(GL_POINT_SIZE, &point_size);
|
||||||
viewer->setGlPointSize(GLfloat(d->point_Slider->value()));
|
viewer->setGlPointSize(GLfloat(d->point_Slider->value()));
|
||||||
|
|
@ -735,14 +734,12 @@ drawPoints(CGAL::Three::Viewer_interface* viewer) const
|
||||||
{
|
{
|
||||||
if(!d->m_points->has_colors())
|
if(!d->m_points->has_colors())
|
||||||
getPointContainer(Priv::Points)->setColor(color());
|
getPointContainer(Priv::Points)->setColor(color());
|
||||||
std::size_t real_size =
|
std::size_t real_size = getPointContainer(Priv::Points)->getFlatDataSize();
|
||||||
getPointContainer(Priv::Points)->getFlatDataSize();
|
|
||||||
getPointContainer(Priv::Points)->setFlatDataSize(ratio_displayed * real_size);
|
getPointContainer(Priv::Points)->setFlatDataSize(ratio_displayed * real_size);
|
||||||
getPointContainer(Priv::Points)->setFlatDataSize(real_size);
|
getPointContainer(Priv::Points)->setFlatDataSize(real_size);
|
||||||
getPointContainer(Priv::Points)->draw(viewer, !d->m_points->has_colors());
|
getPointContainer(Priv::Points)->draw(viewer, !d->m_points->has_colors());
|
||||||
|
|
||||||
real_size =
|
real_size = getPointContainer(Priv::Selected_points)->getFlatDataSize();
|
||||||
getPointContainer(Priv::Selected_points)->getFlatDataSize();
|
|
||||||
getPointContainer(Priv::Selected_points)->setColor(QColor(Qt::red));
|
getPointContainer(Priv::Selected_points)->setColor(QColor(Qt::red));
|
||||||
getPointContainer(Priv::Selected_points)->setFlatDataSize(ratio_displayed * real_size);
|
getPointContainer(Priv::Selected_points)->setFlatDataSize(ratio_displayed * real_size);
|
||||||
getPointContainer(Priv::Selected_points)->setFlatDataSize(real_size);
|
getPointContainer(Priv::Selected_points)->setFlatDataSize(real_size);
|
||||||
|
|
|
||||||
|
|
@ -36,11 +36,11 @@ class SCENE_POINTS_WITH_NORMAL_ITEM_EXPORT Scene_points_with_normal_item
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Scene_points_with_normal_item();
|
Scene_points_with_normal_item();
|
||||||
|
Scene_points_with_normal_item(const SMesh& input_mesh);
|
||||||
Scene_points_with_normal_item(const Scene_points_with_normal_item& toCopy);
|
Scene_points_with_normal_item(const Scene_points_with_normal_item& toCopy);
|
||||||
|
|
||||||
Scene_points_with_normal_item(const SMesh& input_mesh);
|
|
||||||
|
|
||||||
~Scene_points_with_normal_item();
|
~Scene_points_with_normal_item();
|
||||||
|
|
||||||
Scene_points_with_normal_item* clone() const Q_DECL_OVERRIDE;
|
Scene_points_with_normal_item* clone() const Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
// Is selection empty?
|
// Is selection empty?
|
||||||
|
|
|
||||||
|
|
@ -751,7 +751,6 @@ void Scene_surface_mesh_item_priv::initialize_colors() const
|
||||||
|
|
||||||
void Scene_surface_mesh_item_priv::initializeBuffers(CGAL::Three::Viewer_interface* viewer)const
|
void Scene_surface_mesh_item_priv::initializeBuffers(CGAL::Three::Viewer_interface* viewer)const
|
||||||
{
|
{
|
||||||
|
|
||||||
item->getTriangleContainer(1)->initializeBuffers(viewer);
|
item->getTriangleContainer(1)->initializeBuffers(viewer);
|
||||||
item->getTriangleContainer(0)->initializeBuffers(viewer);
|
item->getTriangleContainer(0)->initializeBuffers(viewer);
|
||||||
item->getEdgeContainer(1)->initializeBuffers(viewer);
|
item->getEdgeContainer(1)->initializeBuffers(viewer);
|
||||||
|
|
@ -2416,7 +2415,8 @@ void Scene_surface_mesh_item::computeItemColorVectorAutomatically(bool b)
|
||||||
this->setProperty("recompute_colors",b);
|
this->setProperty("recompute_colors",b);
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_in_vbo(Vbo* vbo, cgal_gl_data* data,
|
void write_in_vbo(Vbo* vbo,
|
||||||
|
cgal_gl_data* data,
|
||||||
std::size_t size)
|
std::size_t size)
|
||||||
{
|
{
|
||||||
vbo->bind();
|
vbo->bind();
|
||||||
|
|
|
||||||
|
|
@ -28,23 +28,28 @@
|
||||||
|
|
||||||
#include "properties.h"
|
#include "properties.h"
|
||||||
|
|
||||||
|
|
||||||
class QSlider;
|
class QSlider;
|
||||||
|
|
||||||
struct Scene_surface_mesh_item_priv;
|
struct Scene_surface_mesh_item_priv;
|
||||||
|
|
||||||
class SCENE_SURFACE_MESH_ITEM_EXPORT Scene_surface_mesh_item
|
class SCENE_SURFACE_MESH_ITEM_EXPORT Scene_surface_mesh_item
|
||||||
: public CGAL::Three::Scene_item_rendering_helper,
|
: public CGAL::Three::Scene_item_rendering_helper,
|
||||||
public CGAL::Three::Scene_item_with_properties,
|
public CGAL::Three::Scene_item_with_properties,
|
||||||
public CGAL::Three::Scene_zoomable_item_interface,
|
public CGAL::Three::Scene_zoomable_item_interface,
|
||||||
public CGAL::Three::Scene_print_item_interface{
|
public CGAL::Three::Scene_print_item_interface
|
||||||
|
{
|
||||||
Q_INTERFACES(CGAL::Three::Scene_print_item_interface)
|
Q_INTERFACES(CGAL::Three::Scene_print_item_interface)
|
||||||
Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PrintInterface/1.0")
|
Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PrintInterface/1.0")
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(CGAL::Three::Scene_zoomable_item_interface)
|
Q_INTERFACES(CGAL::Three::Scene_zoomable_item_interface)
|
||||||
Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.ZoomInterface/1.0")
|
Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.ZoomInterface/1.0")
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef SMesh Face_graph;
|
typedef SMesh Face_graph;
|
||||||
typedef SMesh::Property_map<vertex_descriptor,int> Vertex_selection_map;
|
typedef SMesh::Property_map<vertex_descriptor,int> Vertex_selection_map;
|
||||||
typedef SMesh::Property_map<face_descriptor,int> Face_selection_map;
|
typedef SMesh::Property_map<face_descriptor,int> Face_selection_map;
|
||||||
|
|
||||||
|
void initialize_priv();
|
||||||
Scene_surface_mesh_item();
|
Scene_surface_mesh_item();
|
||||||
// Takes ownership of the argument.
|
// Takes ownership of the argument.
|
||||||
Scene_surface_mesh_item(SMesh*);
|
Scene_surface_mesh_item(SMesh*);
|
||||||
|
|
@ -54,7 +59,6 @@ public:
|
||||||
|
|
||||||
~Scene_surface_mesh_item();
|
~Scene_surface_mesh_item();
|
||||||
|
|
||||||
|
|
||||||
Scene_surface_mesh_item* clone() const Q_DECL_OVERRIDE;
|
Scene_surface_mesh_item* clone() const Q_DECL_OVERRIDE;
|
||||||
void draw(CGAL::Three::Viewer_interface *) const Q_DECL_OVERRIDE;
|
void draw(CGAL::Three::Viewer_interface *) const Q_DECL_OVERRIDE;
|
||||||
void drawEdges(CGAL::Three::Viewer_interface *) const Q_DECL_OVERRIDE;
|
void drawEdges(CGAL::Three::Viewer_interface *) const Q_DECL_OVERRIDE;
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,7 @@ protected:
|
||||||
void setBbox(Bbox b) const;
|
void setBbox(Bbox b) const;
|
||||||
|
|
||||||
virtual void computeElements() const {}
|
virtual void computeElements() const {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend struct PRIV;
|
friend struct PRIV;
|
||||||
mutable PRIV* priv;
|
mutable PRIV* priv;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue