Cleanup: comments (long lines) in freestyle

This commit is contained in:
Campbell Barton 2019-04-30 17:50:57 +10:00
parent 5ca8ac51d0
commit 1e8697cd80
145 changed files with 1218 additions and 1135 deletions

View File

@ -43,7 +43,7 @@ class AppView {
virtual ~AppView();
public:
//inherited
// inherited
inline unsigned int width()
{
return _width;
@ -246,7 +246,7 @@ class AppView {
protected:
float _Fovy;
//The root node container
// The root node container
NodeGroup _RootNode;
NodeDrawingStyle *_ModelRootNode;
NodeDrawingStyle *_SilhouetteRootNode;

View File

@ -179,7 +179,7 @@ Controller::~Controller()
_ProgressBar = NULL;
}
//delete _current_dirs;
// delete _current_dirs;
}
void Controller::setView(AppView *iView)
@ -300,7 +300,7 @@ int Controller::LoadMesh(Render *re, ViewLayer *view_layer, Depsgraph *depsgraph
_RootNode->AddChild(new NodeViewLayer(*re->scene, *view_layer));
sceneHashFunc.reset();
//blenderScene->accept(sceneHashFunc);
// blenderScene->accept(sceneHashFunc);
_RootNode->accept(sceneHashFunc);
if (G.debug & G_DEBUG_FREESTYLE) {
cout << "Scene hash : " << sceneHashFunc.toString() << endl;
@ -626,7 +626,7 @@ void Controller::ComputeViewMap()
void Controller::ComputeSteerableViewMap()
{
#if 0 //soc
#if 0 // soc
if ((!_Canvas) || (!_ViewMap))
return;

View File

@ -58,7 +58,7 @@ class Controller {
void setPassZ(float *buf, int width, int height);
void setContext(bContext *C);
//soc
// soc
void init_options();
int LoadMesh(Render *re, ViewLayer *view_layer, Depsgraph *depsgraph);
@ -175,15 +175,15 @@ class Controller {
private:
// Main Window:
//AppMainWindow *_pMainWindow;
// AppMainWindow *_pMainWindow;
// List of models currently loaded
vector<string> _ListOfModels;
// Current directories
//ConfigIO* _current_dirs;
// ConfigIO* _current_dirs;
//View
// View
// 3D
AppView *_pView;
@ -195,7 +195,7 @@ class Controller {
RenderMonitor *_pRenderMonitor;
//Model
// Model
// Drawing Structure
NodeGroup *_RootNode;
@ -217,7 +217,7 @@ class Controller {
#endif
// debug
//NodeUser<ViewMap> *_ViewMapNode; // FIXME
// NodeUser<ViewMap> *_ViewMapNode; // FIXME
// Chronometer:
Chronometer _Chrono;
@ -229,7 +229,7 @@ class Controller {
int _edgeTesselationNature;
FastGrid _Grid;
//HashGrid _Grid;
// HashGrid _Grid;
BBox<Vec3r> _Scene3dBBox;
unsigned int _SceneNumFaces;
@ -241,9 +241,9 @@ class Controller {
int _render_count;
//AppStyleWindow *_pStyleWindow;
//AppOptionsWindow *_pOptionsWindow;
//AppDensityCurvesWindow *_pDensityCurvesWindow;
// AppStyleWindow *_pStyleWindow;
// AppOptionsWindow *_pOptionsWindow;
// AppDensityCurvesWindow *_pDensityCurvesWindow;
ViewMapBuilder::visibility_algo _VisibilityAlgo;

View File

@ -384,9 +384,10 @@ static void prepare(Render *re, ViewLayer *view_layer, Depsgraph *depsgraph)
bool logical_and = ((lineset->flags & FREESTYLE_LINESET_FE_AND) != 0);
// negation operator
if (lineset->flags & FREESTYLE_LINESET_FE_NOT) {
// convert an Exclusive condition into an Inclusive equivalent using De Morgan's laws:
// NOT (X OR Y) --> (NOT X) AND (NOT Y)
// NOT (X AND Y) --> (NOT X) OR (NOT Y)
// convert an Exclusive condition into an
// Inclusive equivalent using De Morgan's laws:
// - NOT (X OR Y) --> (NOT X) AND (NOT Y)
// - NOT (X AND Y) --> (NOT X) OR (NOT Y)
for (int i = 0; i < num_edge_types; i++)
conditions[i].value *= -1;
logical_and = !logical_and;

View File

@ -28,7 +28,8 @@ namespace Freestyle {
/*! Class to define a regular grid used for ray casting computations
* We don't use a hashtable here. The grid is explicitly stored for faster computations.
* However, this might result in significant increase in memory usage (compared to the regular grid)
* However, this might result in significant increase in memory usage
* (compared to the regular grid).
*/
class FastGrid : public Grid {
public:
@ -43,8 +44,9 @@ class FastGrid : public Grid {
clear();
}
/*! clears the grid
* Deletes all the cells, clears the hashtable, resets size, size of cell, number of cells.
/*!
* clears the grid
* Deletes all the cells, clears the hashtable, resets size, size of cell, number of cells.
*/
virtual void clear();

View File

@ -181,8 +181,8 @@ static BezierCurve GenerateBezier(
alpha_l = det_X_C1 / det_C0_C1;
alpha_r = det_C0_X / det_C0_C1;
/* If alpha negative, use the Wu/Barsky heuristic (see text) (if alpha is 0, you get coincident control points
* that lead to divide by zero in any subsequent NewtonRaphsonRootFind() call).
/* If alpha negative, use the Wu/Barsky heuristic (see text) (if alpha is 0, you get coincident
* control points that lead to divide by zero in any subsequent NewtonRaphsonRootFind() call).
*/
if (alpha_l < 1.0e-6 || alpha_r < 1.0e-6) {
double dist = V2DistanceBetween2Points(&d[last], &d[first]) / 3.0;
@ -194,8 +194,9 @@ static BezierCurve GenerateBezier(
return bezCurve;
}
/* First and last control points of the Bezier curve are positioned exactly at the first and last data points
* Control points 1 and 2 are positioned an alpha distance out on the tangent vectors, left and right, respectively
/* First and last control points of the Bezier curve are positioned exactly at the first and last
* data points Control points 1 and 2 are positioned an alpha distance out on the tangent
* vectors, left and right, respectively
*/
bezCurve[0] = d[first];
bezCurve[3] = d[last];

View File

@ -45,20 +45,24 @@ class GeomCleaner {
/*! Sorts an array of Indexed vertices
* iVertices
* Array of vertices to sort. It is organized as a float series of vertex coordinates: XYZXYZXYZ...
* Array of vertices to sort.
* It is organized as a float series of vertex coordinates: XYZXYZXYZ...
* iVSize
* The size of iVertices array.
* iIndices
* The array containing the vertex indices (used to refer to the vertex coordinates in an indexed face). Each
* element is an unsignedeger multiple of 3.
* The array containing the vertex indices
* (used to refer to the vertex coordinates in an indexed face).
* Each element is an unsignedeger multiple of 3.
* iISize
* The size of iIndices array
* oVertices
* Output of sorted vertices. A vertex v1 precedes another one v2 in this array if v1.x<v2.x,
* or v1.x=v2.x && v1.y < v2.y or v1.x=v2.y && v1.y=v2.y && v1.z < v2.z.
* Output of sorted vertices.
* A vertex v1 precedes another one v2 in this array
* if v1.x<v2.x, or v1.x=v2.x && v1.y < v2.y or v1.x=v2.y && v1.y=v2.y && v1.z < v2.z.
* The array is organized as a 3-float serie giving the vertices coordinates: XYZXYZXYZ...
* oIndices
* Output corresponding to the iIndices array but reorganized in order to match the sorted vertex array.
* Output corresponding to the iIndices array but reorganized in
* order to match the sorted vertex array.
*/
static void SortIndexedVertexArray(const float *iVertices,
unsigned iVSize,
@ -67,13 +71,16 @@ class GeomCleaner {
float **oVertices,
unsigned **oIndices);
/*! Compress a SORTED indexed vertex array by eliminating multiple appearing occurences of a single vertex.
/*! Compress a SORTED indexed vertex array by eliminating multiple
* appearing occurences of a single vertex.
* iVertices
* The SORTED vertex array to compress. It is organized as a float series of vertex coordinates: XYZXYZXYZ...
* The SORTED vertex array to compress.
* It is organized as a float series of vertex coordinates: XYZXYZXYZ...
* iVSize
* The size of iVertices array.
* iIndices
* The array containing the vertex indices (used to refer to the vertex coordinates in an indexed face).
* The array containing the vertex indices
* (used to refer to the vertex coordinates in an indexed face).
* Each element is an unsignedeger multiple of 3.
* iISize
* The size of iIndices array
@ -100,7 +107,8 @@ class GeomCleaner {
* iVSize
* The size of iVertices array.
* iIndices
* The array containing the vertex indices (used to refer to the vertex coordinates in an indexed face).
* The array containing the vertex indices
* (used to refer to the vertex coordinates in an indexed face).
* Each element is an unsignedeger multiple of 3.
* iISize
* The size of iIndices array
@ -120,15 +128,16 @@ class GeomCleaner {
unsigned *oVSize,
unsigned **oIndices);
/*! Cleans an indexed vertex array. (Identical to SortAndCompress except that we use here a hash table
* to create the new array.)
/*! Cleans an indexed vertex array.
* (Identical to SortAndCompress except that we use here a hash table to create the new array.)
* iVertices
* The vertex array to sort then compress. It is organized as a float series of
* vertex coordinates: XYZXYZXYZ...
* iVSize
* The size of iVertices array.
* iIndices
* The array containing the vertex indices (used to refer to the vertex coordinates in an indexed face).
* The array containing the vertex indices
* (used to refer to the vertex coordinates in an indexed face).
* Each element is an unsignedeger multiple of 3.
* iISize
* The size of iIndices array
@ -154,9 +163,10 @@ class GeomCleaner {
};
/*! Binary operators */
//inline bool operator<(const IndexedVertex& iv1, const IndexedVertex& iv2);
// inline bool operator<(const IndexedVertex& iv1, const IndexedVertex& iv2);
/*! Class Indexed Vertex. Used to represent an indexed vertex by storing the vertex coordinates as well as its index */
/*! Class Indexed Vertex. Used to represent an indexed vertex by storing the vertex coordinates as
* well as its index */
class IndexedVertex {
private:
Vec3f _Vector;
@ -223,7 +233,7 @@ class IndexedVertex {
return _Vector[i];
}
//friend inline bool operator<(const IndexedVertex& iv1, const IndexedVertex& iv2);
// friend inline bool operator<(const IndexedVertex& iv1, const IndexedVertex& iv2);
inline bool operator<(const IndexedVertex &v) const
{
return (_Vector < v._Vector);

View File

@ -88,8 +88,8 @@ intersection_test intersect2dSeg2dSeg(
r1 = a2 * p1[0] + b2 * p1[1] + c2;
r2 = a2 * p2[0] + b2 * p2[1] + c2;
// Check signs of r1 and r2. If both point 1 and point 2 lie on same side of second line segment,
// the line segments do not intersect.
// Check signs of r1 and r2. If both point 1 and point 2 lie on same side of second line
// segment, the line segments do not intersect.
if (r1 != 0 && r2 != 0 && r1 * r2 > 0.0)
return (DONT_INTERSECT);
@ -172,8 +172,8 @@ intersection_test intersect2dSeg2dSegParametric(const Vec2r &p1,
r1 = a2 * p1[0] + b2 * p1[1] + c2;
r2 = a2 * p2[0] + b2 * p2[1] + c2;
// Check signs of r1 and r2. If both point 1 and point 2 lie on same side of second line segment,
// the line segments do not intersect.
// Check signs of r1 and r2. If both point 1 and point 2 lie on same side of second line
// segment, the line segments do not intersect.
if (r1 != 0 && r2 != 0 && r1 * r2 > 0.0)
return (DONT_INTERSECT);
@ -202,8 +202,8 @@ intersection_test intersect2dSeg2dSegParametric(const Vec2r &p1,
// 2001-03-05: released the code in its first version
// 2001-06-18: changed the order of the tests, faster
//
// Acknowledgement: Many thanks to Pierre Terdiman for suggestions and discussions on how to optimize code.
// Thanks to David Hunt for finding a ">="-bug!
// Acknowledgement: Many thanks to Pierre Terdiman for suggestions and discussions on how to
// optimize code. Thanks to David Hunt for finding a ">="-bug!
#define X 0
#define Y 1
@ -337,10 +337,10 @@ intersection_test intersect2dSeg2dSegParametric(const Vec2r &p1,
// This internal procedure is defined below.
bool overlapPlaneBox(Vec3r &normal, real d, Vec3r &maxbox);
// Use separating axis theorem to test overlap between triangle and box need to test for overlap in these directions:
// 1) the {x,y,z}-directions (actually, since we use the AABB of the triangle we do not even need to test these)
// 2) normal of the triangle
// 3) crossproduct(edge from tri, {x,y,z}-directin) this gives 3x3=9 more tests
// Use separating axis theorem to test overlap between triangle and box need to test for overlap in
// these directions: 1) the {x,y,z}-directions (actually, since we use the AABB of the triangle we
// do not even need to test these) 2) normal of the triangle 3) crossproduct(edge from tri,
// {x,y,z}-directin) this gives 3x3=9 more tests
bool overlapTriangleBox(Vec3r &boxcenter, Vec3r &boxhalfsize, Vec3r triverts[3])
{
Vec3r v0, v1, v2, normal, e0, e1, e2;
@ -382,8 +382,8 @@ bool overlapTriangleBox(Vec3r &boxcenter, Vec3r &boxhalfsize, Vec3r triverts[3])
// Bullet 1:
// first test overlap in the {x,y,z}-directions
// find min, max of the triangle each direction, and test for overlap in that direction -- this is equivalent
// to testing a minimal AABB around the triangle against the AABB
// find min, max of the triangle each direction, and test for overlap in that direction -- this
// is equivalent to testing a minimal AABB around the triangle against the AABB
// test in X-direction
FINDMINMAX(v0[X], v1[X], v2[X], min, max);
@ -664,7 +664,7 @@ void fromWorldToImage(const Vec3r &p, Vec3r &q, const real transform[4][4], cons
// winX:
q[0] = viewport[0] + viewport[2] * (q[0] + 1.0) / 2.0;
//winY:
// winY:
q[1] = viewport[1] + viewport[3] * (q[1] + 1.0) / 2.0;
}
@ -709,10 +709,10 @@ void fromCameraToWorld(const Vec3r &p, Vec3r &q, const real model_view_matrix[4]
/////////////////////////////////////////////////////////////////////////////
// Copyright 2001, softSurfer (www.softsurfer.com)
// This code may be freely used and modified for any purpose providing that this copyright notice is included with it.
// SoftSurfer makes no warranty for this code, and cannot be held liable for any real or imagined damage resulting
// from its use.
// Users of this code must verify correctness for their application.
// This code may be freely used and modified for any purpose providing that this copyright notice
// is included with it. SoftSurfer makes no warranty for this code, and cannot be held liable for
// any real or imagined damage resulting from its use. Users of this code must verify correctness
// for their application.
#define PERP(u, v) ((u)[0] * (v)[1] - (u)[1] * (v)[0]) // 2D perp product

View File

@ -105,7 +105,8 @@ bool include2dSeg2dArea(const Vec2r &min, const Vec2r &max, const Vec2r &A, cons
/*! Box-triangle overlap test, adapted from Tomas Akenine-Möller code */
bool overlapTriangleBox(Vec3r &boxcenter, Vec3r &boxhalfsize, Vec3r triverts[3]);
/*! Fast, Minimum Storage Ray-Triangle Intersection, adapted from Tomas Möller and Ben Trumbore code. */
/*! Fast, Minimum Storage Ray-Triangle Intersection, adapted from Tomas Möller and Ben Trumbore
* code. */
bool intersectRayTriangle(const Vec3r &orig,
const Vec3r &dir,
const Vec3r &v0,
@ -126,7 +127,8 @@ intersection_test intersectRayPlane(const Vec3r &orig,
const real epsilon = M_EPSILON); // the epsilon to use
/*! Intersection Ray-Bounding box (axis aligned).
* Adapted from Williams et al, "An Efficient Robust Ray-Box Intersection Algorithm", JGT 10:1 (2005), pp. 49-54.
* Adapted from Williams et al, "An Efficient Robust Ray-Box Intersection Algorithm", JGT 10:1
* (2005), pp. 49-54.
*/
bool intersectRayBBox(const Vec3r &orig,
const Vec3r &dir, // ray origin and direction

View File

@ -49,10 +49,10 @@ void firstIntersectionGridVisitor::examineOccluder(Polygon3r *occ)
{
// check whether the edge and the polygon plane are coincident:
//-------------------------------------------------------------
//first let us compute the plane equation.
// first let us compute the plane equation.
Vec3r v1(((occ)->getVertices())[0]);
Vec3d normal((occ)->getNormal());
//soc unused - double d = -(v1 * normal);
// soc unused - double d = -(v1 * normal);
double tmp_u, tmp_v, tmp_t;
if ((occ)->rayIntersect(ray_org_, ray_dir_, tmp_t, tmp_u, tmp_v)) {
@ -167,8 +167,9 @@ void Grid::insertOccluder(Polygon3r *occluder)
getCellCoordinates(min, imin);
// We are now going to fill in the cells overlapping with the polygon bbox.
// If the polygon is a triangle (most of cases), we also check for each of these cells if it is overlapping with
// the triangle in order to only fill in the ones really overlapping the triangle.
// If the polygon is a triangle (most of cases), we also check for each of these cells if it is
// overlapping with the triangle in order to only fill in the ones really overlapping the
// triangle.
unsigned i, x, y, z;
vector<Vec3r>::const_iterator it;
@ -239,8 +240,8 @@ bool Grid::nextRayCell(Vec3u &current_cell, Vec3u &next_cell)
t_min = FLT_MAX; // init tmin with handle of the case where one or 2 _u[i] = 0.
unsigned coord = 0; // predominant coord(0=x, 1=y, 2=z)
// using a parametric equation of a line : B = A + t u, we find the tx, ty and tz respectively coresponding
// to the intersections with the plans:
// using a parametric equation of a line : B = A + t u, we find the tx, ty and tz respectively
// coresponding to the intersections with the plans:
// x = _cell_size[0], y = _cell_size[1], z = _cell_size[2]
for (i = 0; i < 3; i++) {
if (_ray_dir[i] == 0)
@ -318,8 +319,8 @@ Polygon3r *Grid::castRayToFindFirstIntersection(
firstIntersectionGridVisitor visitor(orig, dir, _cell_size);
castRayInternal(visitor);
// ARB: This doesn't work, because occluders are unordered within any cell
// visitor.occluder() will be an occluder, but we have no guarantee it will be the *first* occluder.
// I assume that is the reason this code is not actually used for FindOccludee.
// visitor.occluder() will be an occluder, but we have no guarantee it will be the *first*
// occluder. I assume that is the reason this code is not actually used for FindOccludee.
occluder = visitor.occluder();
t = visitor.t_;
u = visitor.u_;
@ -337,7 +338,7 @@ void Grid::initRay(const Vec3r &orig, const Vec3r &end, unsigned timestamp)
for (unsigned i = 0; i < 3; i++) {
_current_cell[i] = (unsigned)floor((orig[i] - _orig[i]) / _cell_size[i]);
//soc unused - unsigned u = _current_cell[i];
// soc unused - unsigned u = _current_cell[i];
_pt[i] = orig[i] - _orig[i] - _current_cell[i] * _cell_size[i];
}
//_ray_occluders.clear();
@ -358,7 +359,7 @@ bool Grid::initInfiniteRay(const Vec3r &orig, const Vec3r &dir, unsigned timesta
if (box.inside(orig)) {
for (unsigned int i = 0; i < 3; i++) {
_current_cell[i] = (unsigned int)floor((orig[i] - _orig[i]) / _cell_size[i]);
//soc unused - unsigned u = _current_cell[i];
// soc unused - unsigned u = _current_cell[i];
_pt[i] = orig[i] - _orig[i] - _current_cell[i] * _cell_size[i];
}
}
@ -372,7 +373,7 @@ bool Grid::initInfiniteRay(const Vec3r &orig, const Vec3r &dir, unsigned timesta
_current_cell[i] = (unsigned)floor((newOrig[i] - _orig[i]) / _cell_size[i]);
if (_current_cell[i] == _cells_nb[i])
_current_cell[i] = _cells_nb[i] - 1;
//soc unused - unsigned u = _current_cell[i];
// soc unused - unsigned u = _current_cell[i];
_pt[i] = newOrig[i] - _orig[i] - _current_cell[i] * _cell_size[i];
}
}

View File

@ -92,7 +92,7 @@ class Cell {
class GridVisitor {
public:
virtual ~GridVisitor(){}; //soc
virtual ~GridVisitor(){}; // soc
virtual void discoverCell(Cell * /*cell*/)
{
@ -143,7 +143,7 @@ class allOccludersGridVisitor : public GridVisitor {
* The occluder and the intersection information are stored and accessible.
*/
class firstIntersectionGridVisitor : public GridVisitor {
//soc - changed order to remove warnings
// soc - changed order to remove warnings
public:
double u_, v_, t_;
@ -217,7 +217,8 @@ class Grid {
*/
virtual void configure(const Vec3r &orig, const Vec3r &size, unsigned nb);
/*! returns a vector of integer containing the coordinates of the cell containing the point passed as argument
/*! returns a vector of integer containing the coordinates of the cell containing the point
* passed as argument
* p
* The point for which we're looking the cell
*/
@ -241,8 +242,8 @@ class Grid {
/*! returns the cell whose coordinates are pased as argument */
virtual Cell *getCell(const Vec3u &coord) = 0;
/*! returns the cell containing the point passed as argument. If the cell is empty (contains no occluder),
* NULL is returned
/*! returns the cell containing the point passed as argument.
* If the cell is empty (contains no occluder), NULL is returned:
* p
* The point for which we're looking the cell
*/
@ -253,7 +254,8 @@ class Grid {
return getCell(coord);
}
/*! Retrieves the x,y,z coordinates of the origin of the cell whose coordinates (i,j,k) is passed as argument
/*! Retrieves the x,y,z coordinates of the origin of the cell whose coordinates (i,j,k)
* is passed as argument:
* cell_coord
* i,j,k integer coordinates for the cell
* orig
@ -265,7 +267,7 @@ class Grid {
orig[i] = _orig[i] + cell_coord[i] * _cell_size[i];
}
/*! Retrieves the box corresponding to the cell whose coordinates are passed as argument.
/*! Retrieves the box corresponding to the cell whose coordinates are passed as argument:
* cell_coord
* i,j,k integer coordinates for the cell
* min_out
@ -280,9 +282,8 @@ class Grid {
}
/*! inserts a convex polygon occluder
* This method is quite coarse insofar as it adds all cells intersecting the polygon bounding box
* convex_poly
* The list of 3D points constituting a convex polygon
* This method is quite coarse insofar as it adds all cells intersecting the polygon bounding
* box convex_poly The list of 3D points constituting a convex polygon
*/
void insertOccluder(Polygon3r *convex_poly);
@ -301,8 +302,8 @@ class Grid {
// Prepares to cast ray without generating OccludersSet
void initAcceleratedRay(const Vec3r &orig, const Vec3r &end, unsigned timestamp);
/*! Casts an infinite ray (still finishing at the end of the grid) from a starting point and in a given direction.
* Returns the list of occluders contained in the cells intersected by this ray
/*! Casts an infinite ray (still finishing at the end of the grid) from a starting point and in a
* given direction. Returns the list of occluders contained in the cells intersected by this ray
* Starts with a call to InitRay.
*/
void castInfiniteRay(const Vec3r &orig,
@ -313,9 +314,9 @@ class Grid {
// Prepares to cast ray without generating OccludersSet.
bool initAcceleratedInfiniteRay(const Vec3r &orig, const Vec3r &dir, unsigned timestamp);
/*! Casts an infinite ray (still finishing at the end of the grid) from a starting point and in a given direction.
* Returns the first intersection (occluder,t,u,v) or null.
* Starts with a call to InitRay.
/*! Casts an infinite ray (still finishing at the end of the grid) from a starting point and in a
* given direction. Returns the first intersection (occluder,t,u,v) or null. Starts with a call
* to InitRay.
*/
Polygon3r *castRayToFindFirstIntersection(
const Vec3r &orig, const Vec3r &dir, double &t, double &u, double &v, unsigned timestamp);
@ -344,7 +345,7 @@ class Grid {
return _cell_size;
}
//ARB profiling only:
// ARB profiling only:
inline OccludersSet *getOccluders()
{
return &_occluders;
@ -392,12 +393,13 @@ class Grid {
Vec3r _ray_dir; // direction vector for the ray
Vec3u _current_cell; // The current cell being processed (designated by its 3 coordinates)
Vec3r
_pt; // Points corresponding to the incoming and outgoing intersections of one cell with the ray
Vec3r _pt; // Points corresponding to the incoming and outgoing intersections of one cell with
// the ray
real _t_end; // To know when we are at the end of the ray
real _t;
//OccludersSet _ray_occluders; // Set storing the occluders contained in the cells traversed by a ray
// OccludersSet _ray_occluders; // Set storing the occluders contained in the cells traversed by
// a ray
OccludersSet _occluders; // List of all occluders inserted in the grid
#ifdef WITH_CXX_GUARDEDALLOC

View File

@ -26,14 +26,15 @@ namespace Freestyle {
void GridHelpers::getDefaultViewProscenium(real viewProscenium[4])
{
// Get proscenium boundary for culling
// bufferZone determines the amount by which the area processed should exceed the actual image area.
// This is intended to avoid visible artifacts generated along the proscenium edge.
// Perhaps this is no longer needed now that entire view edges are culled at once, since that theoretically
// should eliminate visible artifacts.
// To the extent it is still useful, bufferZone should be put into the UI as configurable percentage value
// bufferZone determines the amount by which the area processed should exceed the actual image
// area. This is intended to avoid visible artifacts generated along the proscenium edge. Perhaps
// this is no longer needed now that entire view edges are culled at once, since that
// theoretically should eliminate visible artifacts. To the extent it is still useful, bufferZone
// should be put into the UI as configurable percentage value
const real bufferZone = 0.05;
// borderZone describes a blank border outside the proscenium, but still inside the image area.
// Only intended for exposing possible artifacts along or outside the proscenium edge during debugging.
// Only intended for exposing possible artifacts along or outside the proscenium edge during
// debugging.
const real borderZone = 0.0;
viewProscenium[0] = g_freestyle.viewport[2] * (borderZone - bufferZone);
viewProscenium[1] = g_freestyle.viewport[2] * (1.0f - borderZone + bufferZone);

View File

@ -126,8 +126,8 @@ class Transform {
inline bool insideProscenium(const real proscenium[4], const Polygon3r &polygon)
{
// N.B. The bounding box check is redundant for inserting occluders into cells, because the cell selection code
// in insertOccluders has already guaranteed that the bounding boxes will overlap.
// N.B. The bounding box check is redundant for inserting occluders into cells, because the cell
// selection code in insertOccluders has already guaranteed that the bounding boxes will overlap.
// First check the viewport edges, since they are the easiest case
// Check if the bounding box is entirely outside the proscenium
Vec3r bbMin, bbMax;

View File

@ -188,8 +188,8 @@ template<class T, class Point> class Segment {
# pragma warning(pop)
#endif
/*! defines a binary function that can be overload by the user to specify at each condition the intersection
* between 2 edges must be computed
/*! defines a binary function that can be overload by the user to specify at each condition the
* intersection between 2 edges must be computed
*/
template<class T1, class T2> struct binary_rule {
binary_rule()

View File

@ -46,7 +46,8 @@ class GaussianFilter {
float _sigma;
float *_mask;
int _bound;
// the real mask size (must be odd)(the size of the mask we store is ((_maskSize+1)/2)*((_maskSize+1)/2))
// the real mask size (must be odd)(the size of the mask we store is
// ((_maskSize+1)/2)*((_maskSize+1)/2))
int _maskSize;
int _storedMaskSize; // (_maskSize+1)/2)
@ -56,13 +57,13 @@ class GaussianFilter {
GaussianFilter &operator=(const GaussianFilter &);
virtual ~GaussianFilter();
/*! Returns the value for pixel x,y of image "map" after a gaussian blur, made using the sigma value.
* The sigma value determines the mask size (~ 2 x sigma).
* \param map:
* The image we wish to work on. The Map template must implement the following methods:
* - float pixel(unsigned int x,unsigned int y) const;
* - unsigned width() const;
* - unsigned height() const;
/*! Returns the value for pixel x,y of image "map" after a gaussian blur, made using the sigma
* value. The sigma value determines the mask size (~ 2 x sigma).
* \param map: The image we wish to work on.
* The Map template must implement the following methods:
* - float pixel(unsigned int x,unsigned int y) const;
* - unsigned width() const;
* - unsigned height() const;
* \param x:
* The abscissa of the pixel where we want to evaluate the gaussian blur.
* \param y:
@ -127,8 +128,8 @@ template<class Map> float GaussianFilter::getSmoothedPixel(Map *map, int x, int
{
float sum = 0.0f;
float L = 0.0f;
int w = (int)map->width(); //soc
int h = (int)map->height(); //soc
int w = (int)map->width(); // soc
int h = (int)map->height(); // soc
// Current pixel is x,y
// Sum surrounding pixels L value:
@ -145,7 +146,7 @@ template<class Map> float GaussianFilter::getSmoothedPixel(Map *map, int x, int
sum += m;
}
}
//L /= sum;
// L /= sum;
return L;
}

View File

@ -35,9 +35,10 @@ namespace Freestyle {
//
///////////////////////////////////////////////////////////////////////////////
/*! This class allows the storing of part of an image, while allowing a normal access to its pixel values.
* You can for example only a rectangle of sw*sh, whose lower-left corner is at (ox, oy), of an image of
* size w*h, and access these pixels using x,y coordinates specified in the whole image coordinate system.
/*! This class allows the storing of part of an image, while allowing a normal access to its pixel
* values. You can for example only a rectangle of sw*sh, whose lower-left corner is at (ox, oy),
* of an image of size w*h, and access these pixels using x,y coordinates specified in the whole
* image coordinate system.
*/
class FrsImage {
public:
@ -209,7 +210,8 @@ class RGBImage : public FrsImage {
/*! Builds an RGB partial image from the useful part buffer.
* \param rgb:
* The array of size 3*sw*sh containing the RGB values of the sw*sh pixels we need to stored.
* These sw*sh pixels constitute a rectangular part of a bigger RGB image containing w*h pixels.
* These sw*sh pixels constitute a rectangular part of a bigger
* RGB image containing w*h pixels.
* \param w:
* The width of the complete image
* \param h:
@ -346,7 +348,8 @@ class GrayImage : public FrsImage {
/*! Builds a partial image from the useful part buffer.
* \param lvl:
* The array of size sw*sh containing the gray values of the sw*sh pixels we need to stored.
* These sw*sh pixels constitute a rectangular part of a bigger gray image containing w*h pixels.
* These sw*sh pixels constitute a rectangular part of a bigger
* gray image containing w*h pixels.
* \param w:
* The width of the complete image
* \param h:

View File

@ -153,7 +153,7 @@ void GaussianPyramid::BuildPyramid(GrayImage *level0, unsigned nbLevels)
unsigned w = pLevel->width();
unsigned h = pLevel->height();
if (nbLevels != 0) {
for (unsigned int i = 0; i < nbLevels; ++i) { //soc
for (unsigned int i = 0; i < nbLevels; ++i) { // soc
w = pLevel->width() >> 1;
h = pLevel->height() >> 1;
GrayImage *img = new GrayImage(w, h);

View File

@ -43,7 +43,7 @@ class ImagePyramid {
{
}
ImagePyramid(const ImagePyramid &iBrother);
//ImagePyramid(const GrayImage& level0, unsigned nbLevels);
// ImagePyramid(const GrayImage& level0, unsigned nbLevels);
virtual ~ImagePyramid();
/*! Builds the pyramid.

View File

@ -31,7 +31,7 @@ extern "C" {
//------------------------INSTANCE METHODS ----------------------------------
//ViewMapGradientNormBP1D(int level, IntegrationType iType=MEAN, float sampling=2.0)
// ViewMapGradientNormBP1D(int level, IntegrationType iType=MEAN, float sampling=2.0)
static char ViewMapGradientNormBP1D___doc__[] =
"Class hierarchy: :class:`freestyle.types.BinaryPredicate1D` > "
@ -82,7 +82,7 @@ static int ViewMapGradientNormBP1D___init__(BPy_ViewMapGradientNormBP1D *self,
return 0;
}
/*-----------------------BPy_ViewMapGradientNormBP1D type definition ------------------------------*/
/*-----------------------BPy_ViewMapGradientNormBP1D type definition ----------------------------*/
PyTypeObject ViewMapGradientNormBP1D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "ViewMapGradientNormBP1D", /* tp_name */

View File

@ -136,7 +136,7 @@ static int CurvePoint_init(BPy_CurvePoint *self, PyObject *args, PyObject *kwds)
return 0;
}
///bool operator== (const CurvePoint &b)
/// bool operator== (const CurvePoint &b)
/*----------------------CurvePoint get/setters ----------------------------*/

View File

@ -161,7 +161,7 @@ static void ChainPredicateIterator_dealloc(BPy_ChainPredicateIterator *self)
ChainingIterator_Type.tp_dealloc((PyObject *)self);
}
/*-----------------------BPy_ChainPredicateIterator type definition ------------------------------*/
/*-----------------------BPy_ChainPredicateIterator type definition ----------------------------*/
PyTypeObject ChainPredicateIterator_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "ChainPredicateIterator", /* tp_name */

View File

@ -31,8 +31,8 @@ extern "C" {
//------------------------INSTANCE METHODS ----------------------------------
// ChainSilhouetteIterator (bool restrict_to_selection=true, ViewEdge *begin=NULL, bool orientation=true)
// ChainSilhouetteIterator (const ChainSilhouetteIterator &brother)
// ChainSilhouetteIterator (bool restrict_to_selection=true, ViewEdge *begin=NULL, bool
// orientation=true) ChainSilhouetteIterator (const ChainSilhouetteIterator &brother)
PyDoc_STRVAR(ChainSilhouetteIterator_doc,
"Class hierarchy: :class:`freestyle.types.Iterator` >\n"
@ -117,7 +117,7 @@ static int ChainSilhouetteIterator_init(BPy_ChainSilhouetteIterator *self,
return 0;
}
/*-----------------------BPy_ChainSilhouetteIterator type definition ------------------------------*/
/*-----------------------BPy_ChainSilhouetteIterator type definition ----------------------------*/
PyTypeObject ChainSilhouetteIterator_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "ChainSilhouetteIterator", /* tp_name */

View File

@ -137,7 +137,7 @@ static PyGetSetDef BPy_orientedViewEdgeIterator_getseters[] = {
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
/*-----------------------BPy_orientedViewEdgeIterator type definition ------------------------------*/
/*-----------------------BPy_orientedViewEdgeIterator type definition ---------------------------*/
PyTypeObject orientedViewEdgeIterator_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "orientedViewEdgeIterator", /* tp_name */

View File

@ -63,7 +63,7 @@ static int BackboneStretcherShader___init__(BPy_BackboneStretcherShader *self,
return 0;
}
/*-----------------------BPy_BackboneStretcherShader type definition ------------------------------*/
/*-----------------------BPy_BackboneStretcherShader type definition ----------------------------*/
PyTypeObject BackboneStretcherShader_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "BackboneStretcherShader", /* tp_name */

View File

@ -31,7 +31,8 @@ extern "C" {
extern PyTypeObject CalligraphicShader_Type;
#define BPy_CalligraphicShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&CalligraphicShader_Type)
#define BPy_CalligraphicShader_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&CalligraphicShader_Type)
/*---------------------------Python BPy_CalligraphicShader structure definition----------*/
typedef struct {

View File

@ -62,7 +62,7 @@ static int ConstantThicknessShader___init__(BPy_ConstantThicknessShader *self,
return 0;
}
/*-----------------------BPy_ConstantThicknessShader type definition ------------------------------*/
/*-----------------------BPy_ConstantThicknessShader type definition ----------------------------*/
PyTypeObject ConstantThicknessShader_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "ConstantThicknessShader", /* tp_name */

View File

@ -68,7 +68,7 @@ static int ConstrainedIncreasingThicknessShader___init__(
return 0;
}
/*-----------------------BPy_ConstrainedIncreasingThicknessShader type definition ------------------------------*/
/*-----------------------BPy_ConstrainedIncreasingThicknessShader type definition ---------------*/
PyTypeObject ConstrainedIncreasingThicknessShader_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "ConstrainedIncreasingThicknessShader", /* tp_name */

View File

@ -34,7 +34,8 @@ extern PyTypeObject ConstrainedIncreasingThicknessShader_Type;
#define BPy_ConstrainedIncreasingThicknessShader_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&ConstrainedIncreasingThicknessShader_Type))
/*---------------------------Python BPy_ConstrainedIncreasingThicknessShader structure definition----------*/
/*---------------------------Python BPy_ConstrainedIncreasingThicknessShader structure
* definition----------*/
typedef struct {
BPy_StrokeShader py_ss;
} BPy_ConstrainedIncreasingThicknessShader;

View File

@ -68,7 +68,7 @@ static int IncreasingThicknessShader___init__(BPy_IncreasingThicknessShader *sel
return 0;
}
/*-----------------------BPy_IncreasingThicknessShader type definition ------------------------------*/
/*-----------------------BPy_IncreasingThicknessShader type definition --------------------------*/
PyTypeObject IncreasingThicknessShader_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "IncreasingThicknessShader", /* tp_name */

View File

@ -69,7 +69,7 @@ static int PolygonalizationShader___init__(BPy_PolygonalizationShader *self,
return 0;
}
/*-----------------------BPy_PolygonalizationShader type definition ------------------------------*/
/*-----------------------BPy_PolygonalizationShader type definition -----------------------------*/
PyTypeObject PolygonalizationShader_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "PolygonalizationShader", /* tp_name */

View File

@ -62,7 +62,7 @@ static int StrokeTextureStepShader___init__(BPy_StrokeTextureStepShader *self,
return 0;
}
/*-----------------------BPy_StrokeTextureStepShader type definition ------------------------------*/
/*-----------------------BPy_StrokeTextureStepShader type definition ----------------------------*/
PyTypeObject StrokeTextureStepShader_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "StrokeTextureStepShader", /* tp_name */

View File

@ -115,7 +115,7 @@ static PyObject *UnaryFunction0DEdgeNature___call__(BPy_UnaryFunction0DEdgeNatur
return BPy_Nature_from_Nature(self->uf0D_edgenature->result);
}
/*-----------------------BPy_UnaryFunction0DEdgeNature type definition ------------------------------*/
/*-----------------------BPy_UnaryFunction0DEdgeNature type definition --------------------------*/
PyTypeObject UnaryFunction0DEdgeNature_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "UnaryFunction0DEdgeNature", /* tp_name */

View File

@ -114,7 +114,7 @@ static PyObject *UnaryFunction0DMaterial___call__(BPy_UnaryFunction0DMaterial *s
return BPy_FrsMaterial_from_FrsMaterial(self->uf0D_material->result);
}
/*-----------------------BPy_UnaryFunction0DMaterial type definition ------------------------------*/
/*-----------------------BPy_UnaryFunction0DMaterial type definition ----------------------------*/
PyTypeObject UnaryFunction0DMaterial_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "UnaryFunction0DMaterial", /* tp_name */

View File

@ -115,7 +115,7 @@ static PyObject *UnaryFunction0DUnsigned___call__(BPy_UnaryFunction0DUnsigned *s
return PyLong_FromLong(self->uf0D_unsigned->result);
}
/*-----------------------BPy_UnaryFunction0DUnsigned type definition ------------------------------*/
/*-----------------------BPy_UnaryFunction0DUnsigned type definition ----------------------------*/
PyTypeObject UnaryFunction0DUnsigned_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "UnaryFunction0DUnsigned", /* tp_name */

View File

@ -124,7 +124,7 @@ static PyObject *UnaryFunction0DVectorViewShape___call__(BPy_UnaryFunction0DVect
return list;
}
/*-----------------------BPy_UnaryFunction0DVectorViewShape type definition ------------------------------*/
/*-----------------------BPy_UnaryFunction0DVectorViewShape type definition ---------------------*/
PyTypeObject UnaryFunction0DVectorViewShape_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "UnaryFunction0DVectorViewShape", /* tp_name */

View File

@ -37,13 +37,15 @@ extern PyTypeObject UnaryFunction0DVectorViewShape_Type;
#define BPy_UnaryFunction0DVectorViewShape_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&UnaryFunction0DVectorViewShape_Type))
/*---------------------------Python BPy_UnaryFunction0DVectorViewShape structure definition----------*/
/*---------------------------Python BPy_UnaryFunction0DVectorViewShape structure
* definition----------*/
typedef struct {
BPy_UnaryFunction0D py_uf0D;
UnaryFunction0D<std::vector<ViewShape *>> *uf0D_vectorviewshape;
} BPy_UnaryFunction0DVectorViewShape;
/*---------------------------Python BPy_UnaryFunction0DVectorViewShape visible prototypes-----------*/
/*---------------------------Python BPy_UnaryFunction0DVectorViewShape visible
* prototypes-----------*/
int UnaryFunction0DVectorViewShape_Init(PyObject *module);
///////////////////////////////////////////////////////////////////////////////////////////

View File

@ -121,7 +121,7 @@ static PyObject *UnaryFunction0DViewShape___call__(BPy_UnaryFunction0DViewShape
return BPy_ViewShape_from_ViewShape(*(self->uf0D_viewshape->result));
}
/*-----------------------BPy_UnaryFunction0DViewShape type definition ------------------------------*/
/*-----------------------BPy_UnaryFunction0DViewShape type definition ---------------------------*/
PyTypeObject UnaryFunction0DViewShape_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "UnaryFunction0DViewShape", /* tp_name */

View File

@ -64,7 +64,7 @@ static int VertexOrientation2DF0D___init__(BPy_VertexOrientation2DF0D *self,
return 0;
}
/*-----------------------BPy_VertexOrientation2DF0D type definition ------------------------------*/
/*-----------------------BPy_VertexOrientation2DF0D type definition -----------------------------*/
PyTypeObject VertexOrientation2DF0D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "VertexOrientation2DF0D", /* tp_name */

View File

@ -64,7 +64,7 @@ static int VertexOrientation3DF0D___init__(BPy_VertexOrientation3DF0D *self,
return 0;
}
/*-----------------------BPy_VertexOrientation3DF0D type definition ------------------------------*/
/*-----------------------BPy_VertexOrientation3DF0D type definition -----------------------------*/
PyTypeObject VertexOrientation3DF0D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "VertexOrientation3DF0D", /* tp_name */

View File

@ -62,7 +62,7 @@ static int GetCurvilinearAbscissaF0D___init__(BPy_GetCurvilinearAbscissaF0D *sel
return 0;
}
/*-----------------------BPy_GetCurvilinearAbscissaF0D type definition ------------------------------*/
/*-----------------------BPy_GetCurvilinearAbscissaF0D type definition --------------------------*/
PyTypeObject GetCurvilinearAbscissaF0D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "GetCurvilinearAbscissaF0D", /* tp_name */

View File

@ -67,7 +67,7 @@ static int GetViewMapGradientNormF0D___init__(BPy_GetViewMapGradientNormF0D *sel
return 0;
}
/*-----------------------BPy_GetViewMapGradientNormF0D type definition ------------------------------*/
/*-----------------------BPy_GetViewMapGradientNormF0D type definition --------------------------*/
PyTypeObject GetViewMapGradientNormF0D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "GetViewMapGradientNormF0D", /* tp_name */

View File

@ -65,7 +65,7 @@ static int ReadCompleteViewMapPixelF0D___init__(BPy_ReadCompleteViewMapPixelF0D
return 0;
}
/*-----------------------BPy_ReadCompleteViewMapPixelF0D type definition ------------------------------*/
/*-----------------------BPy_ReadCompleteViewMapPixelF0D type definition ------------------------*/
PyTypeObject ReadCompleteViewMapPixelF0D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "ReadCompleteViewMapPixelF0D", /* tp_name */

View File

@ -34,7 +34,8 @@ extern PyTypeObject ReadCompleteViewMapPixelF0D_Type;
#define BPy_ReadCompleteViewMapPixelF0D_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&ReadCompleteViewMapPixelF0D_Type))
/*---------------------------Python BPy_ReadCompleteViewMapPixelF0D structure definition----------*/
/*---------------------------Python BPy_ReadCompleteViewMapPixelF0D structure
* definition----------*/
typedef struct {
BPy_UnaryFunction0DFloat py_uf0D_float;
} BPy_ReadCompleteViewMapPixelF0D;

View File

@ -69,7 +69,7 @@ static int ReadSteerableViewMapPixelF0D___init__(BPy_ReadSteerableViewMapPixelF0
return 0;
}
/*-----------------------BPy_ReadSteerableViewMapPixelF0D type definition ------------------------------*/
/*-----------------------BPy_ReadSteerableViewMapPixelF0D type definition -----------------------*/
PyTypeObject ReadSteerableViewMapPixelF0D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "ReadSteerableViewMapPixelF0D", /* tp_name */

View File

@ -34,7 +34,8 @@ extern PyTypeObject ReadSteerableViewMapPixelF0D_Type;
#define BPy_ReadSteerableViewMapPixelF0D_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&ReadSteerableViewMapPixelF0D_Type))
/*---------------------------Python BPy_ReadSteerableViewMapPixelF0D structure definition----------*/
/*---------------------------Python BPy_ReadSteerableViewMapPixelF0D structure
* definition----------*/
typedef struct {
BPy_UnaryFunction0DFloat py_uf0D_float;
} BPy_ReadSteerableViewMapPixelF0D;

View File

@ -67,7 +67,7 @@ static int QuantitativeInvisibilityF0D___init__(BPy_QuantitativeInvisibilityF0D
return 0;
}
/*-----------------------BPy_QuantitativeInvisibilityF0D type definition ------------------------------*/
/*-----------------------BPy_QuantitativeInvisibilityF0D type definition ------------------------*/
PyTypeObject QuantitativeInvisibilityF0D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "QuantitativeInvisibilityF0D", /* tp_name */

View File

@ -34,7 +34,8 @@ extern PyTypeObject QuantitativeInvisibilityF0D_Type;
#define BPy_QuantitativeInvisibilityF0D_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&QuantitativeInvisibilityF0D_Type))
/*---------------------------Python BPy_QuantitativeInvisibilityF0D structure definition----------*/
/*---------------------------Python BPy_QuantitativeInvisibilityF0D structure
* definition----------*/
typedef struct {
BPy_UnaryFunction0DUnsigned py_uf0D_unsigned;
} BPy_QuantitativeInvisibilityF0D;

View File

@ -166,7 +166,7 @@ static PyGetSetDef BPy_UnaryFunction1DEdgeNature_getseters[] = {
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
/*-----------------------BPy_UnaryFunction1DEdgeNature type definition ------------------------------*/
/*-----------------------BPy_UnaryFunction1DEdgeNature type definition --------------------------*/
PyTypeObject UnaryFunction1DEdgeNature_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "UnaryFunction1DEdgeNature", /* tp_name */

View File

@ -166,7 +166,7 @@ static PyGetSetDef BPy_UnaryFunction1DUnsigned_getseters[] = {
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
/*-----------------------BPy_UnaryFunction1DUnsigned type definition ------------------------------*/
/*-----------------------BPy_UnaryFunction1DUnsigned type definition ----------------------------*/
PyTypeObject UnaryFunction1DUnsigned_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "UnaryFunction1DUnsigned", /* tp_name */

View File

@ -190,7 +190,7 @@ static PyGetSetDef BPy_UnaryFunction1DVectorViewShape_getseters[] = {
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
/*-----------------------BPy_UnaryFunction1DVectorViewShape type definition ------------------------------*/
/*-----------------------BPy_UnaryFunction1DVectorViewShape type definition ---------------------*/
PyTypeObject UnaryFunction1DVectorViewShape_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "UnaryFunction1DVectorViewShape", /* tp_name */

View File

@ -37,13 +37,15 @@ extern PyTypeObject UnaryFunction1DVectorViewShape_Type;
#define BPy_UnaryFunction1DVectorViewShape_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&UnaryFunction1DVectorViewShape_Type))
/*---------------------------Python BPy_UnaryFunction1DVectorViewShape structure definition----------*/
/*---------------------------Python BPy_UnaryFunction1DVectorViewShape structure
* definition----------*/
typedef struct {
BPy_UnaryFunction1D py_uf1D;
UnaryFunction1D<std::vector<ViewShape *>> *uf1D_vectorviewshape;
} BPy_UnaryFunction1DVectorViewShape;
/*---------------------------Python BPy_UnaryFunction1DVectorViewShape visible prototypes-----------*/
/*---------------------------Python BPy_UnaryFunction1DVectorViewShape visible
* prototypes-----------*/
int UnaryFunction1DVectorViewShape_Init(PyObject *module);
///////////////////////////////////////////////////////////////////////////////////////////

View File

@ -84,7 +84,7 @@ static int GetCompleteViewMapDensityF1D___init__(BPy_GetCompleteViewMapDensityF1
return 0;
}
/*-----------------------BPy_GetCompleteViewMapDensityF1D type definition ------------------------------*/
/*-----------------------BPy_GetCompleteViewMapDensityF1D type definition -----------------------*/
PyTypeObject GetCompleteViewMapDensityF1D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "GetCompleteViewMapDensityF1D", /* tp_name */

View File

@ -34,7 +34,8 @@ extern PyTypeObject GetCompleteViewMapDensityF1D_Type;
#define BPy_GetCompleteViewMapDensityF1D_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&GetCompleteViewMapDensityF1D_Type))
/*---------------------------Python BPy_GetCompleteViewMapDensityF1D structure definition----------*/
/*---------------------------Python BPy_GetCompleteViewMapDensityF1D structure
* definition----------*/
typedef struct {
BPy_UnaryFunction1DDouble py_uf1D_double;
} BPy_GetCompleteViewMapDensityF1D;

View File

@ -91,7 +91,7 @@ static int GetDirectionalViewMapDensityF1D___init__(BPy_GetDirectionalViewMapDen
return 0;
}
/*-----------------------BPy_GetDirectionalViewMapDensityF1D type definition ------------------------------*/
/*-----------------------BPy_GetDirectionalViewMapDensityF1D type definition --------------------*/
PyTypeObject GetDirectionalViewMapDensityF1D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "GetDirectionalViewMapDensityF1D", /* tp_name */

View File

@ -34,7 +34,8 @@ extern PyTypeObject GetDirectionalViewMapDensityF1D_Type;
#define BPy_GetDirectionalViewMapDensityF1D_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&GetDirectionalViewMapDensityF1D_Type))
/*---------------------------Python BPy_GetDirectionalViewMapDensityF1D structure definition----------*/
/*---------------------------Python BPy_GetDirectionalViewMapDensityF1D structure
* definition----------*/
typedef struct {
BPy_UnaryFunction1DDouble py_uf1D_double;
} BPy_GetDirectionalViewMapDensityF1D;

View File

@ -81,7 +81,7 @@ static int GetSteerableViewMapDensityF1D___init__(BPy_GetSteerableViewMapDensity
return 0;
}
/*-----------------------BPy_GetSteerableViewMapDensityF1D type definition ------------------------------*/
/*-----------------------BPy_GetSteerableViewMapDensityF1D type definition ----------------------*/
PyTypeObject GetSteerableViewMapDensityF1D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "GetSteerableViewMapDensityF1D", /* tp_name */

View File

@ -33,7 +33,8 @@ extern PyTypeObject GetSteerableViewMapDensityF1D_Type;
#define BPy_GetSteerableViewMapDensityF1D_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&GetSteerableViewMapDensityF1D_Type))
/*---------------------------Python BPy_GetSteerableViewMapDensityF1D structure definition----------*/
/*---------------------------Python BPy_GetSteerableViewMapDensityF1D structure
* definition----------*/
typedef struct {
BPy_UnaryFunction1DDouble py_uf1D_double;
} BPy_GetSteerableViewMapDensityF1D;

View File

@ -81,7 +81,7 @@ static int GetViewMapGradientNormF1D___init__(BPy_GetViewMapGradientNormF1D *sel
return 0;
}
/*-----------------------BPy_GetViewMapGradientNormF1D type definition ------------------------------*/
/*-----------------------BPy_GetViewMapGradientNormF1D type definition --------------------------*/
PyTypeObject GetViewMapGradientNormF1D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "GetViewMapGradientNormF1D", /* tp_name */

View File

@ -72,7 +72,7 @@ static int QuantitativeInvisibilityF1D___init__(BPy_QuantitativeInvisibilityF1D
return 0;
}
/*-----------------------BPy_QuantitativeInvisibilityF1D type definition ------------------------------*/
/*-----------------------BPy_QuantitativeInvisibilityF1D type definition ------------------------*/
PyTypeObject QuantitativeInvisibilityF1D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "QuantitativeInvisibilityF1D", /* tp_name */

View File

@ -34,7 +34,8 @@ extern PyTypeObject QuantitativeInvisibilityF1D_Type;
#define BPy_QuantitativeInvisibilityF1D_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&QuantitativeInvisibilityF1D_Type))
/*---------------------------Python BPy_QuantitativeInvisibilityF1D structure definition----------*/
/*---------------------------Python BPy_QuantitativeInvisibilityF1D structure
* definition----------*/
typedef struct {
BPy_UnaryFunction1DUnsigned py_uf1D_unsigned;
} BPy_QuantitativeInvisibilityF1D;

View File

@ -59,7 +59,7 @@ static int IncrementChainingTimeStampF1D___init__(BPy_IncrementChainingTimeStamp
return 0;
}
/*-----------------------BPy_IncrementChainingTimeStampF1D type definition ------------------------------*/
/*-----------------------BPy_IncrementChainingTimeStampF1D type definition ----------------------*/
PyTypeObject IncrementChainingTimeStampF1D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "IncrementChainingTimeStampF1D", /* tp_name */

View File

@ -34,7 +34,8 @@ extern PyTypeObject IncrementChainingTimeStampF1D_Type;
#define BPy_IncrementChainingTimeStampF1D_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&IncrementChainingTimeStampF1D_Type))
/*---------------------------Python BPy_IncrementChainingTimeStampF1D structure definition----------*/
/*---------------------------Python BPy_IncrementChainingTimeStampF1D structure
* definition----------*/
typedef struct {
BPy_UnaryFunction1DVoid py_uf1D_void;
} BPy_IncrementChainingTimeStampF1D;

View File

@ -62,7 +62,7 @@ static int EqualToChainingTimeStampUP1D___init__(BPy_EqualToChainingTimeStampUP1
return 0;
}
/*-----------------------BPy_EqualToChainingTimeStampUP1D type definition ------------------------------*/
/*-----------------------BPy_EqualToChainingTimeStampUP1D type definition -----------------------*/
PyTypeObject EqualToChainingTimeStampUP1D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "EqualToChainingTimeStampUP1D", /* tp_name */

View File

@ -34,7 +34,8 @@ extern PyTypeObject EqualToChainingTimeStampUP1D_Type;
#define BPy_EqualToChainingTimeStampUP1D_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&EqualToChainingTimeStampUP1D_Type))
/*---------------------------Python BPy_EqualToChainingTimeStampUP1D structure definition----------*/
/*---------------------------Python BPy_EqualToChainingTimeStampUP1D structure
* definition----------*/
typedef struct {
BPy_UnaryPredicate1D py_up1D;
} BPy_EqualToChainingTimeStampUP1D;

View File

@ -66,7 +66,7 @@ static int QuantitativeInvisibilityUP1D___init__(BPy_QuantitativeInvisibilityUP1
return 0;
}
/*-----------------------BPy_QuantitativeInvisibilityUP1D type definition ------------------------------*/
/*-----------------------BPy_QuantitativeInvisibilityUP1D type definition -----------------------*/
PyTypeObject QuantitativeInvisibilityUP1D_Type = {
PyVarObject_HEAD_INIT(NULL, 0) "QuantitativeInvisibilityUP1D", /* tp_name */

View File

@ -34,7 +34,8 @@ extern PyTypeObject QuantitativeInvisibilityUP1D_Type;
#define BPy_QuantitativeInvisibilityUP1D_Check(v) \
(PyObject_IsInstance((PyObject *)v, (PyObject *)&QuantitativeInvisibilityUP1D_Type))
/*---------------------------Python BPy_QuantitativeInvisibilityUP1D structure definition----------*/
/*---------------------------Python BPy_QuantitativeInvisibilityUP1D structure
* definition----------*/
typedef struct {
BPy_UnaryPredicate1D py_up1D;
} BPy_QuantitativeInvisibilityUP1D;

View File

@ -99,13 +99,11 @@ class IndexedFaceSet : public Rep {
* iMISize
* The size of iMIndices
* iTIndices
* The Texture coordinates indices (per vertex). The integers contained in this array must be multiple of 2.
* iTISize
* The size of iMIndices
* iCopy
* 0 : the arrays are not copied. The pointers passed as arguments are used. IndexedFaceSet takes these
* arrays desallocation in charge.
* 1 : the arrays are copied. The caller is in charge of the arrays, passed as arguments desallocation.
* The Texture coordinates indices (per vertex). The integers contained in this array must
* be multiple of 2. iTISize The size of iMIndices iCopy 0 : the arrays are not copied. The
* pointers passed as arguments are used. IndexedFaceSet takes these arrays desallocation in
* charge. 1 : the arrays are copied. The caller is in charge of the arrays, passed as arguments
* desallocation.
*/
IndexedFaceSet(float *iVertices,
unsigned iVSize,

View File

@ -19,7 +19,8 @@
/** \file
* \ingroup freestyle
* \brief Abstract class for scene graph nodes. Inherits from BaseObject which defines the addRef release mechanism.
* \brief Abstract class for scene graph nodes. Inherits from BaseObject which defines the addRef
* release mechanism.
*/
#include "SceneVisitor.h"

View File

@ -16,7 +16,8 @@
/** \file
* \ingroup freestyle
* \brief Class to define a Drawing Style to be applied to the underlying children. Inherits from NodeGroup.
* \brief Class to define a Drawing Style to be applied to the underlying children. Inherits from
* NodeGroup.
*/
#include "NodeDrawingStyle.h"

View File

@ -19,7 +19,8 @@
/** \file
* \ingroup freestyle
* \brief Class to define a Drawing Style to be applied to the underlying children. Inherits from NodeGroup.
* \brief Class to define a Drawing Style to be applied to the underlying children. Inherits from
* NodeGroup.
*/
#include "DrawingStyle.h"

View File

@ -17,7 +17,8 @@
/** \file
* \ingroup freestyle
* \brief Class to represent a group node. This node can contains several children.
* \brief It also contains a transform matrix indicating the transform state of the underlying children.
* \brief It also contains a transform matrix indicating the transform state of the underlying
* children.
*/
#include "NodeGroup.h"
@ -36,10 +37,9 @@ void NodeGroup::AddChild(Node *iChild)
int NodeGroup::destroy()
{
/*! Node::destroy makes a release on the object and then returns the reference counter.
* If the reference counter is equal to 0, that means that nobody else is linking this node group and
* that we can destroy the whole underlying tree.
* Else, one or several Node link this node group, and we only returns the reference counter
* decremented by Node::destroy();
* If the reference counter is equal to 0, that means that nobody else is linking this node
* group and that we can destroy the whole underlying tree. Else, one or several Node link this
* node group, and we only returns the reference counter decremented by Node::destroy();
*/
int refThis = Node::destroy();

View File

@ -20,7 +20,8 @@
/** \file
* \ingroup freestyle
* \brief Class to represent a group node. This node can contains several children.
* \brief It also contains a transform matrix indicating the transform state of the underlying children.
* \brief It also contains a transform matrix indicating the transform state of the underlying
* children.
*/
#include <vector>

View File

@ -35,7 +35,7 @@ void NodeTransform::Translate(real x, real y, real z)
void NodeTransform::Rotate(real iAngle, real x, real y, real z)
{
//Normalize the x,y,z vector;
// Normalize the x,y,z vector;
real norm = (real)sqrt(x * x + y * y + z * z);
if (0 == norm)
return;

View File

@ -16,7 +16,8 @@
/** \file
* \ingroup freestyle
* \brief Base class for all shapes. Inherits from BasicObjects for references counter management (addRef, release).
* \brief Base class for all shapes. Inherits from BasicObjects for references counter management
* (addRef, release).
*/
#include "Rep.h"

View File

@ -19,7 +19,8 @@
/** \file
* \ingroup freestyle
* \brief Base class for all shapes. Inherits from BasicObjects for references counter management (addRef, release).
* \brief Base class for all shapes.
* Inherits from BasicObjects for references counter management (addRef, release).
*/
#include <string>
@ -111,8 +112,8 @@ class Rep : public BaseObject {
}
/*! Computes the rep bounding box.
* Each Inherited rep must compute its bbox depending on the way the data are stored. So, each inherited class
* must overload this method
* Each Inherited rep must compute its bbox depending on the way the data are stored. So, each
* inherited class must overload this method
*/
virtual void ComputeBBox() = 0;

View File

@ -38,15 +38,15 @@ namespace Functions0D {
// DensityF0D
/*! Returns the density of the (result) image evaluated at an Interface0D.
* This density is evaluated using a pixels square window around the evaluation point and integrating
* these values using a gaussian.
* This density is evaluated using a pixels square window around the evaluation point and
* integrating these values using a gaussian.
*/
class DensityF0D : public UnaryFunction0D<double> {
public:
/*! Builds the functor from the gaussian sigma value.
* \param sigma:
* sigma indicates the x value for which the gaussian function is 0.5. It leads to the window size value.
* (the larger, the smoother)
* sigma indicates the x value for which the gaussian function is 0.5.
* It leads to the window size value. (the larger, the smoother)
*/
DensityF0D(double sigma = 2) : UnaryFunction0D<double>()
{

View File

@ -104,14 +104,14 @@ int GetSteerableViewMapDensityF1D::operator()(Interface1D &inter)
int GetDirectionalViewMapDensityF1D::operator()(Interface1D &inter)
{
//soc unsigned size;
// soc unsigned size;
result = integrate(_fun, inter.pointsBegin(_sampling), inter.pointsEnd(_sampling), _integration);
return 0;
}
int GetCompleteViewMapDensityF1D::operator()(Interface1D &inter)
{
//soc unsigned size;
// soc unsigned size;
/* Id id = inter.getId(); */ /* UNUSED */
result = integrate(_fun, inter.pointsBegin(_sampling), inter.pointsEnd(_sampling), _integration);
return 0;

View File

@ -37,8 +37,9 @@ namespace Functions1D {
// DensityF1D
/*! Returns the density evaluated for an Interface1D.
* The density is evaluated for a set of points along the Interface1D (using the DensityF0D functor) with a
* user-defined sampling and then integrated into a single value using a user-defined integration method.
* The density is evaluated for a set of points along the Interface1D (using the DensityF0D
* functor) with a user-defined sampling and then integrated into a single value using a
* user-defined integration method.
*/
class DensityF1D : public UnaryFunction1D<double> {
private:
@ -51,9 +52,9 @@ class DensityF1D : public UnaryFunction1D<double> {
* \param iType:
* The integration method used to compute a single value from a set of values.
* \param sampling:
* The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
* the result is obtained by combining the resulting values into a single one, following the method specified
* by iType.
* The resolution used to sample the chain: the corresponding 0D function is evaluated at each
* sample point and the result is obtained by combining the resulting values into a single one,
* following the method specified by iType.
*/
DensityF1D(double sigma = 2, IntegrationType iType = MEAN, float sampling = 2.0f)
: UnaryFunction1D<double>(iType), _fun(sigma)
@ -86,8 +87,9 @@ class DensityF1D : public UnaryFunction1D<double> {
// LocalAverageDepthF1D
/*! Returns the average depth evaluated for an Interface1D.
* The average depth is evaluated for a set of points along the Interface1D (using the LocalAverageDepthF0D functor)
* with a user-defined sampling and then integrated into a single value using a user-defined integration method.
* The average depth is evaluated for a set of points along the Interface1D (using the
* LocalAverageDepthF0D functor) with a user-defined sampling and then integrated into a single
* value using a user-defined integration method.
*/
class LocalAverageDepthF1D : public UnaryFunction1D<double> {
public:
@ -121,8 +123,9 @@ class LocalAverageDepthF1D : public UnaryFunction1D<double> {
// GetCompleteViewMapDensity
/*! Returns the density evaluated for an Interface1D in the complete viewmap image.
* The density is evaluated for a set of points along the Interface1D (using the ReadCompleteViewMapPixelF0D functor)
* and then integrated into a single value using a user-defined integration method.
* The density is evaluated for a set of points along the Interface1D (using the
* ReadCompleteViewMapPixelF0D functor) and then integrated into a single value using a
* user-defined integration method.
*/
class GetCompleteViewMapDensityF1D : public UnaryFunction1D<double> {
public:
@ -162,7 +165,8 @@ class GetCompleteViewMapDensityF1D : public UnaryFunction1D<double> {
// GetDirectionalViewMapDensity
/*! Returns the density evaluated for an Interface1D in of the steerable viewmaps image.
* The direction telling which Directional map to choose is explicitly specified by the user.
* The density is evaluated for a set of points along the Interface1D (using the ReadSteerableViewMapPixelF0D functor)
* The density is evaluated for a set of points along the Interface1D
* (using the ReadSteerableViewMapPixelF0D functor)
* and then integrated into a single value using a user-defined integration method.
*/
class GetDirectionalViewMapDensityF1D : public UnaryFunction1D<double> {
@ -175,9 +179,9 @@ class GetDirectionalViewMapDensityF1D : public UnaryFunction1D<double> {
* \param iType:
* The integration method used to compute a single value from a set of values.
* \param sampling:
* The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
* the result is obtained by combining the resulting values into a single one, following the method specified
* by iType.
* The resolution used to sample the chain: the corresponding 0D function is evaluated at
* each sample point and the result is obtained by combining the resulting values into a
* single one, following the method specified by iType.
*/
GetDirectionalViewMapDensityF1D(unsigned iOrientation,
unsigned level,
@ -203,8 +207,8 @@ class GetDirectionalViewMapDensityF1D : public UnaryFunction1D<double> {
};
// GetSteerableViewMapDensityF1D
/*! Returns the density of the viewmap for a given Interface1D. The density of each FEdge is evaluated
* in the proper steerable ViewMap depending on its oorientation.
/*! Returns the density of the viewmap for a given Interface1D. The density of each FEdge is
* evaluated in the proper steerable ViewMap depending on its oorientation.
*/
class GetSteerableViewMapDensityF1D : public UnaryFunction1D<double> {
private:
@ -218,9 +222,9 @@ class GetSteerableViewMapDensityF1D : public UnaryFunction1D<double> {
* \param iType:
* The integration method used to compute a single value from a set of values.
* \param sampling:
* The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
* the result is obtained by combining the resulting values into a single one, following the method specified
* by iType.
* The resolution used to sample the chain: the corresponding 0D function is evaluated at each
* sample point and the result is obtained by combining the resulting values into a single one,
* following the method specified by iType.
*/
GetSteerableViewMapDensityF1D(int level, IntegrationType iType = MEAN, float sampling = 2.0f)
: UnaryFunction1D<double>(iType)
@ -245,8 +249,8 @@ class GetSteerableViewMapDensityF1D : public UnaryFunction1D<double> {
};
// GetViewMapGradientNormF1D
/*! Returns the density of the viewmap for a given Interface1D. The density of each FEdge is evaluated in
* the proper steerable ViewMap depending on its oorientation.
/*! Returns the density of the viewmap for a given Interface1D. The density of each FEdge is
* evaluated in the proper steerable ViewMap depending on its oorientation.
*/
class GetViewMapGradientNormF1D : public UnaryFunction1D<double> {
private:
@ -261,9 +265,9 @@ class GetViewMapGradientNormF1D : public UnaryFunction1D<double> {
* \param iType:
* The integration method used to compute a single value from a set of values.
* \param sampling:
* The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
* the result is obtained by combining the resulting values into a single one, following the method specified
* by iType.
* The resolution used to sample the chain: the corresponding 0D function is evaluated at each
* sample point and the result is obtained by combining the resulting values into a single
* one, following the method specified by iType.
*/
GetViewMapGradientNormF1D(int level, IntegrationType iType = MEAN, float sampling = 2.0f)
: UnaryFunction1D<double>(iType), _func(level)

View File

@ -261,7 +261,7 @@ void Smoother::iteration()
edgeStopping(diffC2, _anisoCurvature) *
diffC2; //_factorCurvatureDifference;
motionCurvature *= _factorCurvatureDifference;
//motionCurvature = _factorCurvatureDifference * (diffC1 + diffC2);
// motionCurvature = _factorCurvatureDifference * (diffC1 + diffC2);
if (_safeTest)
_vertex[i] = Vec2r(_vertex[i] + (motionNormal + motionCurvature) * _normal[i]);
Vec2r v1(_vertex[i - 1] - _vertex[i]);
@ -283,7 +283,7 @@ void Smoother::iteration()
edgeStopping(diffC2, _anisoCurvature) *
diffC2; //_factorCurvatureDifference;
motionCurvature *= _factorCurvatureDifference;
//motionCurvature = _factorCurvatureDifference * (diffC1 + diffC2);
// motionCurvature = _factorCurvatureDifference * (diffC1 + diffC2);
_vertex[0] = Vec2r(_vertex[0] + (motionNormal + motionCurvature) * _normal[0]);
_vertex[_nbVertices - 1] = _vertex[0];
}

View File

@ -27,9 +27,9 @@
namespace Freestyle {
/*! [ Thickness Shader ].
* Assigns thicknesses to the stroke vertices so that the stroke looks like made with a calligraphic tool.
* i.e. The stroke will be the thickest in a main direction, the thinest in the direction perpendicular to this one,
* and an interpolation inbetween.
* Assigns thicknesses to the stroke vertices so that the stroke looks like made with a
* calligraphic tool. i.e. The stroke will be the thickest in a main direction, the thinest in the
* direction perpendicular to this one, and an interpolation inbetween.
*/
class CalligraphicShader : public StrokeShader {
public:
@ -103,9 +103,9 @@ class SpatialNoiseShader : public StrokeShader {
/*! [ Geometry Shader ].
* Smoothes the stroke.
* (Moves the vertices to make the stroke smoother).
* Uses curvature flow to converge towards a curve of constant curvature. The diffusion method we use is anisotropic
* to prevent the diffusion accross corners.
* \see \htmlonly <a href=/smoothing/smoothing.html>smoothing/smoothing.html</a> \endhtmlonly
* Uses curvature flow to converge towards a curve of constant curvature. The diffusion method we
* use is anisotropic to prevent the diffusion accross corners. \see \htmlonly <a
* href=/smoothing/smoothing.html>smoothing/smoothing.html</a> \endhtmlonly
*/
class SmoothingShader : public StrokeShader {
public:

View File

@ -57,7 +57,8 @@ int ConstantThicknessShader::shade(Stroke &stroke) const
int i = 0;
int size = stroke.strokeVerticesSize();
for (v = stroke.strokeVerticesBegin(), vend = stroke.strokeVerticesEnd(); v != vend; ++v) {
// XXX What's the use of i here? And is not the thickness always overriden by the last line of the loop?
// XXX What's the use of i here? And is not the thickness always overriden by the last line of
// the loop?
if ((1 == i) || (size - 2 == i))
v->attribute().setThickness(_thickness / 4.0, _thickness / 4.0);
if ((0 == i) || (size - 1 == i))
@ -74,7 +75,8 @@ int ConstantExternThicknessShader::shade(Stroke &stroke) const
int i = 0;
int size = stroke.strokeVerticesSize();
for (v = stroke.strokeVerticesBegin(), vend = stroke.strokeVerticesEnd(); v != vend; ++v) {
// XXX What's the use of i here? And is not the thickness always overriden by the last line of the loop?
// XXX What's the use of i here? And is not the thickness always overriden by the last line of
// the loop?
if ((1 == i) || (size - 2 == i))
v->attribute().setThickness(_thickness / 2.0, 0);
if ((0 == i) || (size - 1 == i))
@ -109,7 +111,8 @@ int ConstrainedIncreasingThicknessShader::shade(Stroke &stroke) const
StrokeInternal::StrokeVertexIterator v, vend;
for (i = 0, v = stroke.strokeVerticesBegin(), vend = stroke.strokeVerticesEnd(); v != vend;
++v, ++i) {
// XXX Why not using an if/else here? Else, if last condition is true, everything else is computed for nothing!
// XXX Why not using an if/else here? Else, if last condition is true, everything else is
// computed for nothing!
float t;
if (i < (float)n / 2.0f)
t = (1.0 - (float)i / (float)n) * _ThicknessMin + (float)i / (float)n * maxT;
@ -140,7 +143,8 @@ int LengthDependingThicknessShader::shade(Stroke &stroke) const
int i = 0;
int size = stroke.strokeVerticesSize();
for (v = stroke.strokeVerticesBegin(), vend = stroke.strokeVerticesEnd(); v != vend; ++v) {
// XXX What's the use of i here? And is not the thickness always overriden by the last line of the loop?
// XXX What's the use of i here? And is not the thickness always overriden by the last line of
// the loop?
if ((1 == i) || (size - 2 == i))
v->attribute().setThickness(thickness / 4.0, thickness / 4.0);
if ((0 == i) || (size - 1 == i))
@ -337,7 +341,7 @@ int SamplingShader::shade(Stroke &stroke) const
int ExternalContourStretcherShader::shade(Stroke &stroke) const
{
//float l = stroke.getLength2D();
// float l = stroke.getLength2D();
Interface0DIterator it;
Functions0D::Normal2DF0D fun;
StrokeVertex *sv;
@ -362,7 +366,7 @@ int BezierCurveShader::shade(Stroke &stroke) const
// Build the Bezier curve from this set of data points:
vector<Vec2d> data;
StrokeInternal::StrokeVertexIterator v = stroke.strokeVerticesBegin(), vend;
data.push_back(Vec2d(v->x(), v->y())); //first one
data.push_back(Vec2d(v->x(), v->y())); // first one
StrokeInternal::StrokeVertexIterator previous = v;
++v;
for (vend = stroke.strokeVerticesEnd(); v != vend; ++v) {
@ -562,7 +566,7 @@ int PolygonalizationShader::shade(Stroke &stroke) const
Vec2d u = (*cp)->B - (*cp)->A;
Vec2d n(u[1], -u[0]);
n.normalize();
//Vec2d n(0, 0);
// Vec2d n(0, 0);
float offset = ((*cp)->_error);
StrokeInternal::StrokeVertexIterator v;
for (v = a; v != b; ++v) {
@ -653,7 +657,7 @@ int TipRemoverShader::shade(Stroke &stroke) const
// Resample so that our new stroke have the same number of vertices than before
stroke.Resample(originalSize);
if ((int)stroke.strokeVerticesSize() != originalSize) //soc
if ((int)stroke.strokeVerticesSize() != originalSize) // soc
cerr << "Warning: resampling problem" << endl;
// assign old attributes to new stroke vertices:

View File

@ -81,9 +81,9 @@ class ConstantThicknessShader : public StrokeShader {
};
/* [ Thickness Shader ].
* Assigns an absolute constant external thickness to every vertices of the Stroke. The external thickness of a point
* is its thickness from the point to the strip border in the direction pointing outside the object the
* Stroke delimitates.
* Assigns an absolute constant external thickness to every vertices of the Stroke. The external
* thickness of a point is its thickness from the point to the strip border in the direction
* pointing outside the object the Stroke delimitates.
*/
class ConstantExternThicknessShader : public StrokeShader {
public:
@ -108,10 +108,10 @@ class ConstantExternThicknessShader : public StrokeShader {
};
/*! [ Thickness Shader ].
* Assigns thicknesses values such as the thickness increases from a thickness value A to a thickness value B between
* the first vertex to the midpoint vertex and then decreases from B to a A between this midpoint vertex
* and the last vertex.
* The thickness is linearly interpolated from A to B.
* Assigns thicknesses values such as the thickness increases from a thickness value A to a
* thickness value B between the first vertex to the midpoint vertex and then decreases from B to a
* A between this midpoint vertex and the last vertex. The thickness is linearly interpolated from
* A to B.
*/
class IncreasingThicknessShader : public StrokeShader {
public:
@ -146,8 +146,8 @@ class IncreasingThicknessShader : public StrokeShader {
};
/*! [ Thickness shader ].
* Same as previous but here we allow the user to control the ratio thickness/length so that we don't get
* fat short lines
* Same as previous but here we allow the user to control the ratio thickness/length so that we
* don't get fat short lines
*/
class ConstrainedIncreasingThicknessShader : public StrokeShader {
private:
@ -288,8 +288,8 @@ class ConstantColorShader : public StrokeShader {
/*! [ Color Shader ].
* Assigns a varying color to the stroke.
* The user specifies 2 colors A and B. The stroke color will change linearly from A to B between the
* first and the last vertex.
* The user specifies 2 colors A and B. The stroke color will change linearly from A to B between
* the first and the last vertex.
*/
class IncreasingColorShader : public StrokeShader {
private:
@ -346,7 +346,8 @@ class IncreasingColorShader : public StrokeShader {
};
/* [ Color Shader ].
* Assigns a color to the stroke depending on the material of the shape to which ot belongs to. (Disney shader)
* Assigns a color to the stroke depending on the material of the shape to which ot belongs to.
* (Disney shader)
*/
class MaterialColorShader : public StrokeShader {
private:
@ -399,7 +400,8 @@ class ColorNoiseShader : public StrokeShader {
//
///////////////////////////////////////////////////////////////////////////////
/*! [ Geometry Shader ].
* Stretches the stroke at its two extremities and following the respective directions: v(1)v(0) and v(n-1)v(n).
* Stretches the stroke at its two extremities and following the respective directions: v(1)v(0)
* and v(n-1)v(n).
*/
class BackboneStretcherShader : public StrokeShader {
private:
@ -471,9 +473,9 @@ class ExternalContourStretcherShader : public StrokeShader {
// Bezier curve stroke shader
/*! [ Geometry Shader ].
* Transforms the stroke backbone geometry so that it corresponds to a Bezier Curve approximation of the
* original backbone geometry.
* \see \htmlonly <a href=bezier/bezier.html>bezier/bezier.html</a> \endhtmlonly
* Transforms the stroke backbone geometry so that it corresponds to a Bezier Curve approximation
* of the original backbone geometry. \see \htmlonly <a
* href=bezier/bezier.html>bezier/bezier.html</a> \endhtmlonly
*/
class BezierCurveShader : public StrokeShader {
private:
@ -501,8 +503,9 @@ class BezierCurveShader : public StrokeShader {
/*! [ Geometry Shader ].
* Shader to modify the Stroke geometry so that it looks more "polygonal".
* The basic idea is to start from the minimal stroke approximation consisting in a line joining the first vertex
* to the last one and to subdivide using the original stroke vertices until a certain error is reached.
* The basic idea is to start from the minimal stroke approximation consisting in a line joining
* the first vertex to the last one and to subdivide using the original stroke vertices until a
* certain error is reached.
*/
class PolygonalizationShader : public StrokeShader {
private:
@ -511,9 +514,9 @@ class PolygonalizationShader : public StrokeShader {
public:
/*! Builds the shader.
* \param iError:
* The error we want our polygonal approximation to have with respect to the original geometry.
* The smaller, the closer the new stroke to the orinal one.
* This error corresponds to the maximum distance between the new stroke and the old one.
* The error we want our polygonal approximation to have with respect to the original
* geometry. The smaller, the closer the new stroke to the orinal one. This error corresponds to
* the maximum distance between the new stroke and the old one.
*/
PolygonalizationShader(float iError) : StrokeShader()
{
@ -542,8 +545,9 @@ class GuidingLinesShader : public StrokeShader {
public:
/*! Builds a Guiding Lines shader
* \param iOffset:
* The line that replaces the stroke is initially in the middle of the initial stroke "bbox".
* iOffset is the value of the displacement which is applied to this line along its normal.
* The line that replaces the stroke is initially in the middle of the initial stroke
* "bbox". iOffset is the value of the displacement which is applied to this line along its
* normal.
*/
GuidingLinesShader(float iOffset) : StrokeShader()
{

View File

@ -38,8 +38,8 @@
#include "BKE_global.h"
//soc #include <qimage.h>
//soc #include <QString>
// soc #include <qimage.h>
// soc #include <QString>
extern "C" {
#include "IMB_imbuf.h"
@ -325,7 +325,7 @@ void Canvas::loadMap(const char *iFileName,
filePath = iFileName;
}
#if 0 //soc
#if 0 // soc
QImage *qimg;
QImage newMap(filePath.c_str());
if (newMap.isNull()) {
@ -402,7 +402,7 @@ void Canvas::loadMap(const char *iFileName,
GaussianPyramid *pyramid = new GaussianPyramid(tmp, iNbLevels, iSigma);
int ow = pyramid->width(0);
int oh = pyramid->height(0);
string base(iMapName); //soc
string base(iMapName); // soc
for (int i = 0; i < pyramid->getNumberOfLevels(); ++i) {
// save each image:
#if 0
@ -410,19 +410,19 @@ void Canvas::loadMap(const char *iFileName,
h = pyramid.height(i);
#endif
//soc QImage qtmp(ow, oh, QImage::Format_RGB32);
// soc QImage qtmp(ow, oh, QImage::Format_RGB32);
ImBuf *qtmp = IMB_allocImBuf(ow, oh, 32, IB_rect);
//int k = (1 << i);
// int k = (1 << i);
for (y = 0; y < oh; ++y) {
for (x = 0; x < ow; ++x) {
int c = pyramid->pixel(x, y, i); // 255 * pyramid->pixel(x, y, i);
//soc qtmp.setPixel(x, y, qRgb(c, c, c));
// soc qtmp.setPixel(x, y, qRgb(c, c, c));
pix = (char *)qtmp->rect + y * rowbytes + x * 4;
pix[0] = pix[1] = pix[2] = c;
}
}
//soc qtmp.save(base + QString::number(i) + ".bmp", "BMP");
// soc qtmp.save(base + QString::number(i) + ".bmp", "BMP");
stringstream filename;
filename << base;
filename << i << ".bmp";
@ -443,7 +443,7 @@ void Canvas::loadMap(const char *iFileName,
#endif
_maps[iMapName] = pyramid;
//newMap->save("toto.bmp", "BMP");
// newMap->save("toto.bmp", "BMP");
}
float Canvas::readMapPixel(const char *iMapName, int level, int x, int y)

View File

@ -137,8 +137,8 @@ class Canvas {
}
/* Maps management */
/*! Loads an image map. The map will be scaled (without preserving the ratio in order to fit the actual
* canvas size.).
/*! Loads an image map. The map will be scaled
* (without preserving the ratio in order to fit the actual canvas size.).
* The image must be a gray values image...
* \param iFileName:
* The name of the image file
@ -160,9 +160,11 @@ class Canvas {
* \param level:
* The level of the pyramid from which the pixel must be read.
* \param x:
* The abscissa of the desired pixel specified in level0 coordinate system. The origin is the lower left corner.
* The abscissa of the desired pixel specified in level0 coordinate system.
* The origin is the lower left corner.
* \param y:
* The ordinate of the desired pixel specified in level0 coordinate system. The origin is the lower left corner.
* The ordinate of the desired pixel specified in level0 coordinate system.
* The origin is the lower left corner.
*/
float readMapPixel(const char *iMapName, int level, int x, int y);

View File

@ -76,7 +76,7 @@ void Chain::push_viewedge_back(ViewEdge *iViewEdge, bool orientation)
} while ((v != vend) && (v != vfirst));
if (v == vfirst) {
//Add last one:
// Add last one:
current = (*v)->point2d();
Curve::push_vertex_back(*v);
//_Length += (current - previous).norm();
@ -138,7 +138,7 @@ void Chain::push_viewedge_front(ViewEdge *iViewEdge, bool orientation)
} while ((v != vend) && (v != vfirst));
if (v == vfirst) {
//Add last one:
// Add last one:
current = (*v)->point2d();
Curve::push_vertex_front(*v);
//_Length += (current - previous).norm();

View File

@ -143,10 +143,11 @@ int ChainSilhouetteIterator::traverse(const AdjacencyIterator &ait)
return 0;
}
if (nextVertex->getNature() & Nature::NON_T_VERTEX) {
//soc NonTVertex *nontvertex = (NonTVertex*)nextVertex;
// soc NonTVertex *nontvertex = (NonTVertex*)nextVertex;
ViewEdge *newEdge(0);
// we'll try to chain the edges by keeping the same nature...
// the preseance order is : SILHOUETTE, BORDER, CREASE, MATERIAL_BOUNDARY, EDGE_MARK, SUGGESTIVE, VALLEY, RIDGE
// the preseance order is : SILHOUETTE, BORDER, CREASE, MATERIAL_BOUNDARY, EDGE_MARK,
// SUGGESTIVE, VALLEY, RIDGE
Nature::EdgeNature natures[8] = {
Nature::SILHOUETTE,
Nature::BORDER,

View File

@ -32,7 +32,7 @@
#include "../view_map/ViewMapIterators.h"
#include "../view_map/ViewMapAdvancedIterators.h"
//using namespace ViewEdgeInternal;
// using namespace ViewEdgeInternal;
namespace Freestyle {
@ -98,7 +98,8 @@ class AdjacencyIterator : public Iterator {
return _internalIterator.isBegin();
}
/*! Returns true if the current ViewEdge is coming towards the iteration vertex. False otherwise. */
/*! Returns true if the current ViewEdge is coming towards the iteration vertex. False otherwise.
*/
bool isIncoming() const;
/*! Returns a *pointer* to the pointed ViewEdge. */
@ -144,14 +145,15 @@ class AdjacencyIterator : public Iterator {
* It makes the works of chaining rules description easier.
* The two main methods that need to overloaded are traverse() and init().
* traverse() tells which ViewEdge to follow, among the adjacent ones.
* If you specify restriction rules (such as "Chain only ViewEdges of the selection"), they will be included
* in the adjacency iterator. (i.e, the adjacent iterator will only stop on "valid" edges).
* If you specify restriction rules (such as "Chain only ViewEdges of the selection"), they will
* be included in the adjacency iterator. (i.e, the adjacent iterator will only stop on "valid"
* edges).
*/
class ChainingIterator : public ViewEdgeInternal::ViewEdgeIterator {
protected:
bool _restrictToSelection;
bool _restrictToUnvisited;
bool _increment; //true if we're currently incrementing, false when decrementing
bool _increment; // true if we're currently incrementing, false when decrementing
public:
ViewEdge *result;
@ -159,13 +161,11 @@ class ChainingIterator : public ViewEdgeInternal::ViewEdgeIterator {
/*! Builds a Chaining Iterator from the first ViewEdge used for iteration and its orientation.
* \param iRestrictToSelection:
* Indicates whether to force the chaining to stay within the set of selected ViewEdges or not.
* \param iRestrictToUnvisited:
* Indicates whether a ViewEdge that has already been chained must be ignored ot not.
* \param begin:
* The ViewEdge from which to start the chain.
* \param orientation:
* The direction to follow to explore the graph. If true, the direction indicated by the first ViewEdge is used.
* Indicates whether to force the chaining to stay within the set of selected ViewEdges or
* not. \param iRestrictToUnvisited: Indicates whether a ViewEdge that has already been chained
* must be ignored ot not. \param begin: The ViewEdge from which to start the chain. \param
* orientation: The direction to follow to explore the graph. If true, the direction indicated by
* the first ViewEdge is used.
*/
ChainingIterator(bool iRestrictToSelection = true,
bool iRestrictToUnvisited = true,
@ -200,17 +200,19 @@ class ChainingIterator : public ViewEdgeInternal::ViewEdgeIterator {
*/
virtual int init();
/*! This method iterates over the potential next ViewEdges and returns the one that will be followed next.
* returns the next ViewEdge to follow or 0 when the end of the chain is reached.
/*! This method iterates over the potential next ViewEdges and returns the one that will be
* followed next. returns the next ViewEdge to follow or 0 when the end of the chain is reached.
* \param it:
* The iterator over the ViewEdges adjacent to the end vertex of the current ViewEdge.
* The Adjacency iterator reflects the restriction rules by only iterating over the valid ViewEdges.
* The Adjacency iterator reflects the restriction rules by only iterating over the valid
* ViewEdges.
*/
virtual int traverse(const AdjacencyIterator &it);
/* accessors */
/*! Returns true if the orientation of the current ViewEdge corresponds to its natural orientation */
//inline bool getOrientation() const {}
/*! Returns true if the orientation of the current ViewEdge corresponds to its natural
* orientation */
// inline bool getOrientation() const {}
/*! Returns the vertex which is the next crossing */
inline ViewVertex *getVertex()
@ -251,20 +253,18 @@ class ChainingIterator : public ViewEdgeInternal::ViewEdgeIterator {
/*! A ViewEdge Iterator used to follow ViewEdges the most naturally.
* For example, it will follow visible ViewEdges of same nature.
* As soon, as the nature or the visibility changes, the iteration stops (by setting the pointed ViewEdge to 0).
* In the case of an iteration over a set of ViewEdge that are both Silhouette and Crease, there will be a precedence
* of the silhouette over the crease criterion.
* As soon, as the nature or the visibility changes, the iteration stops (by setting the pointed
* ViewEdge to 0). In the case of an iteration over a set of ViewEdge that are both Silhouette and
* Crease, there will be a precedence of the silhouette over the crease criterion.
*/
class ChainSilhouetteIterator : public ChainingIterator {
public:
/*! Builds a ChainSilhouetteIterator from the first ViewEdge used for iteration and its orientation.
* \param iRestrictToSelection:
* Indicates whether to force the chaining to stay within the set of selected ViewEdges or not.
* \param begin:
* The ViewEdge from where to start the iteration.
* \param orientation:
* If true, we'll look for the next ViewEdge among the ViewEdges that surround the ending ViewVertex of begin.
* If false, we'll search over the ViewEdges surrounding the ending ViewVertex of begin.
/*! Builds a ChainSilhouetteIterator from the first ViewEdge used for iteration and its
* orientation. \param iRestrictToSelection: Indicates whether to force the chaining to stay
* within the set of selected ViewEdges or not. \param begin: The ViewEdge from where to start
* the iteration. \param orientation: If true, we'll look for the next ViewEdge among the
* ViewEdges that surround the ending ViewVertex of begin. If false, we'll search over the
* ViewEdges surrounding the ending ViewVertex of begin.
*/
ChainSilhouetteIterator(bool iRestrictToSelection = true,
ViewEdge *begin = NULL,
@ -284,8 +284,8 @@ class ChainSilhouetteIterator : public ChainingIterator {
return "ChainSilhouetteIterator";
}
/*! This method iterates over the potential next ViewEdges and returns the one that will be followed next.
* When reaching the end of a chain, 0 is returned.
/*! This method iterates over the potential next ViewEdges and returns the one that will be
* followed next. When reaching the end of a chain, 0 is returned.
*/
virtual int traverse(const AdjacencyIterator &it);
@ -301,13 +301,13 @@ class ChainSilhouetteIterator : public ChainingIterator {
//
///////////////////////////////////////////////////////////
/*! A "generic" user-controlled ViewEdge iterator. This iterator is in particular built from a unary predicate and
* a binary predicate.
* First, the unary predicate is evaluated for all potential next ViewEdges in order to only keep the ones respecting
* a certain constraint.
* Then, the binary predicate is evaluated on the current ViewEdge together with each ViewEdge of the previous
* selection. The first ViewEdge respecting both the unary predicate and the binary predicate is kept as the next one.
* If none of the potential next ViewEdge respects these 2 predicates, 0 is returned.
/*! A "generic" user-controlled ViewEdge iterator. This iterator is in particular built from a
* unary predicate and a binary predicate. First, the unary predicate is evaluated for all
* potential next ViewEdges in order to only keep the ones respecting a certain constraint. Then,
* the binary predicate is evaluated on the current ViewEdge together with each ViewEdge of the
* previous selection. The first ViewEdge respecting both the unary predicate and the binary
* predicate is kept as the next one. If none of the potential next ViewEdge respects these 2
* predicates, 0 is returned.
*/
class ChainPredicateIterator : public ChainingIterator {
protected:
@ -318,14 +318,12 @@ class ChainPredicateIterator : public ChainingIterator {
public:
/*! Builds a ChainPredicateIterator from a starting ViewEdge and its orientation.
* \param iRestrictToSelection:
* Indicates whether to force the chaining to stay within the set of selected ViewEdges or not.
* \param iRestrictToUnvisited:
* Indicates whether a ViewEdge that has already been chained must be ignored ot not.
* \param begin:
* The ViewEdge from where to start the iteration.
* \param orientation:
* If true, we'll look for the next ViewEdge among the ViewEdges that surround the ending ViewVertex of begin.
* If false, we'll search over the ViewEdges surrounding the ending ViewVertex of begin.
* Indicates whether to force the chaining to stay within the set of selected ViewEdges or
* not. \param iRestrictToUnvisited: Indicates whether a ViewEdge that has already been chained
* must be ignored ot not. \param begin: The ViewEdge from where to start the iteration. \param
* orientation: If true, we'll look for the next ViewEdge among the ViewEdges that surround the
* ending ViewVertex of begin. If false, we'll search over the ViewEdges surrounding the ending
* ViewVertex of begin.
*/
ChainPredicateIterator(bool iRestrictToSelection = true,
bool iRestrictToUnvisited = true,
@ -337,21 +335,18 @@ class ChainPredicateIterator : public ChainingIterator {
_unary_predicate = 0;
}
/*! Builds a ChainPredicateIterator from a unary predicate, a binary predicate, a starting ViewEdge and
* its orientation.
* \param iRestrictToSelection:
* Indicates whether to force the chaining to stay within the set of selected ViewEdges or not.
* \param iRestrictToUnvisited:
/*! Builds a ChainPredicateIterator from a unary predicate, a binary predicate, a starting
* ViewEdge and its orientation. \param iRestrictToSelection: Indicates whether to force the
* chaining to stay within the set of selected ViewEdges or not. \param iRestrictToUnvisited:
* Indicates whether a ViewEdge that has already been chained must be ignored ot not.
* \param upred:
* The unary predicate that the next ViewEdge must satisfy.
* \param bpred:
* The binary predicate that the next ViewEdge must satisfy together with the actual pointed ViewEdge.
* \param begin:
* The ViewEdge from where to start the iteration.
* \param orientation:
* If true, we'll look for the next ViewEdge among the ViewEdges that surround the ending ViewVertex of begin.
* If false, we'll search over the ViewEdges surrounding the ending ViewVertex of begin.
* The binary predicate that the next ViewEdge must satisfy together with the actual pointed
* ViewEdge. \param begin: The ViewEdge from where to start the iteration. \param orientation: If
* true, we'll look for the next ViewEdge among the ViewEdges that surround the ending ViewVertex
* of begin. If false, we'll search over the ViewEdges surrounding the ending ViewVertex of
* begin.
*/
ChainPredicateIterator(UnaryPredicate1D &upred,
BinaryPredicate1D &bpred,
@ -385,8 +380,8 @@ class ChainPredicateIterator : public ChainingIterator {
return "ChainPredicateIterator";
}
/*! This method iterates over the potential next ViewEdges and returns the one that will be followed next.
* When reaching the end of a chain, 0 is returned.
/*! This method iterates over the potential next ViewEdges and returns the one that will be
* followed next. When reaching the end of a chain, 0 is returned.
*/
virtual int traverse(const AdjacencyIterator &it);

View File

@ -527,7 +527,7 @@ Curve::point_iterator Curve::points_begin(float step)
++second;
return point_iterator(
_Vertices.begin(), second, _Vertices.begin(), _Vertices.end(), _nSegments, step, 0.0f, 0.0f);
//return point_iterator(_Vertices.begin(), second, _nSegments, step, 0.0f, 0.0f);
// return point_iterator(_Vertices.begin(), second, _nSegments, step, 0.0f, 0.0f);
}
Curve::const_point_iterator Curve::points_begin(float step) const
@ -536,7 +536,7 @@ Curve::const_point_iterator Curve::points_begin(float step) const
++second;
return const_point_iterator(
_Vertices.begin(), second, _Vertices.begin(), _Vertices.end(), _nSegments, step, 0.0f, 0.0f);
//return const_point_iterator(_Vertices.begin(), second, _nSegments, step, 0.0f, 0.0f);
// return const_point_iterator(_Vertices.begin(), second, _nSegments, step, 0.0f, 0.0f);
}
Curve::point_iterator Curve::points_end(float step)
@ -549,7 +549,7 @@ Curve::point_iterator Curve::points_end(float step)
step,
1.0f,
_Length);
//return point_iterator(_Vertices.end(), _Vertices.end(), _nSegments, step, 1.0f, _Length);
// return point_iterator(_Vertices.end(), _Vertices.end(), _nSegments, step, 1.0f, _Length);
}
Curve::const_point_iterator Curve::points_end(float step) const
@ -562,7 +562,8 @@ Curve::const_point_iterator Curve::points_end(float step) const
step,
1.0f,
_Length);
//return const_point_iterator(_Vertices.end(), _Vertices.end(), _nSegments, step, 1.0f, _Length);
// return const_point_iterator(_Vertices.end(), _Vertices.end(), _nSegments, step, 1.0f,
// _Length);
}
// Adavnced Iterators access

View File

@ -55,10 +55,10 @@ using namespace Geometry;
/*! Class to represent a point of a curve.
* A CurvePoint can be any point of a 1D curve (it doesn't have to be a vertex of the curve).
* Any Interface1D is built upon ViewEdges, themselves built upon FEdges. Therefore, a curve is basically
* a polyline made of a list SVertex.
* Thus, a CurvePoint is built by lineraly interpolating two SVertex.
* CurvePoint can be used as virtual points while querying 0D information along a curve at a given resolution.
* Any Interface1D is built upon ViewEdges, themselves built upon FEdges. Therefore, a curve is
* basically a polyline made of a list SVertex. Thus, a CurvePoint is built by lineraly
* interpolating two SVertex. CurvePoint can be used as virtual points while querying 0D
* information along a curve at a given resolution.
*/
class CurvePoint : public Interface0D {
public: // Implementation of Interface0D
@ -188,7 +188,7 @@ class CurvePoint : public Interface0D {
SVertex *__A;
SVertex *__B;
float _t2d;
//float _t3d;
// float _t3d;
Vec3r _Point2d;
Vec3r _Point3d;
@ -216,7 +216,7 @@ class CurvePoint : public Interface0D {
*/
CurvePoint(CurvePoint *iA, CurvePoint *iB, float t2d);
//CurvePoint(SVertex *iA, SVertex *iB, float t2d, float t3d);
// CurvePoint(SVertex *iA, SVertex *iB, float t2d, float t3d);
/*! Copy Constructor. */
CurvePoint(const CurvePoint &iBrother);
@ -302,12 +302,12 @@ class CurvePoint : public Interface0D {
}
Vec3r normal() const;
//FrsMaterial material() const;
//Id shape_id() const;
// FrsMaterial material() const;
// Id shape_id() const;
const SShape *shape() const;
//float shape_importance() const;
// float shape_importance() const;
//const unsigned qi() const;
// const unsigned qi() const;
occluder_container::const_iterator occluders_begin() const;
occluder_container::const_iterator occluders_end() const;
bool occluders_empty() const;
@ -564,25 +564,25 @@ class Curve : public Interface1D {
CurveInternal::CurvePointIterator curveVerticesEnd();
// Iterators access
/*! Returns an Interface0DIterator pointing onto the first vertex of the Curve and that can iterate
* over the \a vertices of the Curve.
/*! Returns an Interface0DIterator pointing onto the first vertex of the Curve and that can
* iterate over the \a vertices of the Curve.
*/
virtual Interface0DIterator verticesBegin();
/*! Returns an Interface0DIterator pointing after the last vertex of the Curve and that can iterate
* over the \a vertices of the Curve.
/*! Returns an Interface0DIterator pointing after the last vertex of the Curve and that can
* iterate over the \a vertices of the Curve.
*/
virtual Interface0DIterator verticesEnd();
/*! Returns an Interface0DIterator pointing onto the first point of the Curve and that can iterate
* over the \a points of the Curve at any resolution.
* At each iteration a virtual temporary CurvePoint is created.
/*! Returns an Interface0DIterator pointing onto the first point of the Curve and that can
* iterate over the \a points of the Curve at any resolution. At each iteration a virtual
* temporary CurvePoint is created.
*/
virtual Interface0DIterator pointsBegin(float t = 0.0f);
/*! Returns an Interface0DIterator pointing after the last point of the Curve and that can iterate
* over the \a points of the Curve at any resolution.
* At each iteration a virtual temporary CurvePoint is created.
/*! Returns an Interface0DIterator pointing after the last point of the Curve and that can
* iterate over the \a points of the Curve at any resolution. At each iteration a virtual
* temporary CurvePoint is created.
*/
virtual Interface0DIterator pointsEnd(float t = 0.0f);

View File

@ -50,8 +50,8 @@ class CurvePoint_nonconst_traits : public Nonconst_traits<CurvePoint *> {
/* */
/**********************************/
/*! iterator on a curve. Allows an iterating outside initial vertices. A CurvePoint is instanciated an returned
* when the iterator is dereferenced.
/*! iterator on a curve. Allows an iterating outside initial vertices. A CurvePoint is
* instanciated an returned when the iterator is dereferenced.
*/
template<class Traits>
class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Traits> {
@ -86,7 +86,7 @@ class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Tr
friend class __point_iterator<CurvePoint_nonconst_traits>;
friend class iterator;
#endif
//protected:
// protected:
public:
float _CurvilinearLength;
float _step;
@ -169,7 +169,7 @@ class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Tr
delete _Point;
}
//protected: //FIXME
// protected: //FIXME
public:
inline __point_iterator(vertex_container_iterator iA,
vertex_container_iterator iB,
@ -307,7 +307,7 @@ class __point_iterator : public IteratorBase<Traits, BidirectionalIteratorTag_Tr
else {
_t = 1.0f; // AB is a null segment, we're directly at its end
}
//if normAB ~= 0, we don't change these values
// if normAB ~= 0, we don't change these values
if (_t >= 1) {
_CurvilinearLength -= normAB * (_t - 1);
if (_currentn == _n - 1) {

View File

@ -187,7 +187,7 @@ class CurvePointIterator : public Interface0DIteratorNested {
return false;
}
//protected:
// protected:
virtual int increment()
{
if ((_currentn == _n - 1) && (_t == 1.0f)) {
@ -223,7 +223,7 @@ class CurvePointIterator : public Interface0DIteratorNested {
else {
_t = 1.0f; // AB is a null segment, we're directly at its end
}
//if normAB ~= 0, we don't change these values
// if normAB ~= 0, we don't change these values
if (_t >= 1) {
_CurvilinearLength -= normAB * (_t - 1);
if (_currentn == _n - 1) {
@ -241,7 +241,7 @@ class CurvePointIterator : public Interface0DIteratorNested {
virtual int decrement()
{
if (_t == 0.0f) { //we're at the beginning of the edge
if (_t == 0.0f) { // we're at the beginning of the edge
_t = 1.0f;
--_currentn;
--__A;

View File

@ -278,7 +278,7 @@ void Operators::bidirectionalChain(ViewEdgeIterator &it, UnaryPredicate1D &pred)
Chain *new_chain = new Chain(id);
++id;
# if 0 //FIXME
# if 0 // FIXME
ViewEdgeIterator it_back(it);
--it_back;
# endif
@ -841,7 +841,7 @@ static int __recursiveSplit(Chain *_curve,
real _min = FLT_MAX;
++it;
real mean = 0.f;
//soc unused - real variance = 0.0f;
// soc unused - real variance = 0.0f;
unsigned count = 0;
CurveInternal::CurvePointIterator next = it;
++next;
@ -865,7 +865,7 @@ static int __recursiveSplit(Chain *_curve,
}
mean /= (float)count;
//if ((!bsplit) || (mean - _min > mean)) { // we didn't find any minimum
// if ((!bsplit) || (mean - _min > mean)) { // we didn't find any minimum
if (!bsplit) { // we didn't find any minimum
newChains.push_back(_curve);
return 0;
@ -1210,7 +1210,7 @@ inline int applyShading(Stroke &stroke, vector<StrokeShader *> &shaders)
int Operators::create(UnaryPredicate1D &pred, vector<StrokeShader *> shaders)
{
//Canvas* canvas = Canvas::getInstance();
// Canvas* canvas = Canvas::getInstance();
if (!_current_set) {
cerr << "Warning: current set empty" << endl;
return 0;
@ -1229,7 +1229,7 @@ int Operators::create(UnaryPredicate1D &pred, vector<StrokeShader *> shaders)
delete stroke;
goto error;
}
//canvas->RenderStroke(stroke);
// canvas->RenderStroke(stroke);
new_strokes_set.push_back(stroke);
}
}

View File

@ -43,8 +43,9 @@
namespace Freestyle {
/*! Class defining the operators used in a style module.
* There are 4 classes of operators: Selection, Chaining, Splitting and Creating. All these operators are
* user controlled in the scripting language through Functors, Predicates and Shaders that are taken as arguments.
* There are 4 classes of operators: Selection, Chaining, Splitting and Creating. All these
* operators are user controlled in the scripting language through Functors, Predicates and Shaders
* that are taken as arguments.
*/
class Operators {
@ -63,146 +64,127 @@ class Operators {
static int select(UnaryPredicate1D &pred);
/*! Builds a set of chains from the current set of ViewEdges.
* Each ViewEdge of the current list starts a new chain. The chaining operator then iterates over the ViewEdges
* of the ViewMap using the user specified iterator.
* This operator only iterates using the increment operator and is therefore unidirectional.
* \param it:
* The iterator on the ViewEdges of the ViewMap. It contains the chaining rule.
* \param pred:
* The predicate on the ViewEdge that expresses the stopping condition.
* \param modifier:
* A function that takes a ViewEdge as argument and that is used to modify the processed ViewEdge
* state (the timestamp incrementation is a typical illustration of such a modifier)
* Each ViewEdge of the current list starts a new chain. The chaining operator then iterates
* over the ViewEdges of the ViewMap using the user specified iterator. This operator only
* iterates using the increment operator and is therefore unidirectional. \param it: The iterator
* on the ViewEdges of the ViewMap. It contains the chaining rule. \param pred: The predicate on
* the ViewEdge that expresses the stopping condition. \param modifier: A function that takes a
* ViewEdge as argument and that is used to modify the processed ViewEdge state (the timestamp
* incrementation is a typical illustration of such a modifier)
*/
static int chain(ViewEdgeInternal::ViewEdgeIterator &it,
UnaryPredicate1D &pred,
UnaryFunction1D_void &modifier);
/*! Builds a set of chains from the current set of ViewEdges.
* Each ViewEdge of the current list starts a new chain. The chaining operator then iterates over the ViewEdges
* of the ViewMap using the user specified iterator.
* This operator only iterates using the increment operator and is therefore unidirectional.
* This chaining operator is different from the previous one because it doesn't take any modifier as argument.
* Indeed, the time stamp (insuring that a ViewEdge is processed one time) is automatically managed in this case.
* \param it:
* The iterator on the ViewEdges of the ViewMap. It contains the chaining rule.
* \param pred:
* The predicate on the ViewEdge that expresses the stopping condition.
* Each ViewEdge of the current list starts a new chain. The chaining operator then iterates
* over the ViewEdges of the ViewMap using the user specified iterator. This operator only
* iterates using the increment operator and is therefore unidirectional. This chaining operator
* is different from the previous one because it doesn't take any modifier as argument. Indeed,
* the time stamp (insuring that a ViewEdge is processed one time) is automatically managed in
* this case. \param it: The iterator on the ViewEdges of the ViewMap. It contains the chaining
* rule. \param pred: The predicate on the ViewEdge that expresses the stopping condition.
*/
static int chain(ViewEdgeInternal::ViewEdgeIterator &it, UnaryPredicate1D &pred);
/*! Builds a set of chains from the current set of ViewEdges.
* Each ViewEdge of the current list potentially starts a new chain. The chaining operator then iterates over
* the ViewEdges of the ViewMap using the user specified iterator.
* This operator iterates both using the increment and decrement operators and is therefore bidirectional.
* This operator works with a ChainingIterator which contains the chaining rules. It is this last one which can
* be told to chain only edges that belong to the selection or not to process twice a ViewEdge during the chaining.
* Each time a ViewEdge is added to a chain, its chaining time stamp is incremented. This allows you to keep track
* of the number of chains to which a ViewEdge belongs to.
* \param it:
* The ChainingIterator on the ViewEdges of the ViewMap. It contains the chaining rule.
* \param pred:
* The predicate on the ViewEdge that expresses the stopping condition.
* Each ViewEdge of the current list potentially starts a new chain. The chaining operator then
* iterates over the ViewEdges of the ViewMap using the user specified iterator. This operator
* iterates both using the increment and decrement operators and is therefore bidirectional. This
* operator works with a ChainingIterator which contains the chaining rules. It is this last one
* which can be told to chain only edges that belong to the selection or not to process twice a
* ViewEdge during the chaining. Each time a ViewEdge is added to a chain, its chaining time
* stamp is incremented. This allows you to keep track of the number of chains to which a
* ViewEdge belongs to. \param it: The ChainingIterator on the ViewEdges of the ViewMap. It
* contains the chaining rule. \param pred: The predicate on the ViewEdge that expresses the
* stopping condition.
*/
static int bidirectionalChain(ChainingIterator &it, UnaryPredicate1D &pred);
/*! The only difference with the above bidirectional chaining algorithm is that we don't need to pass a stopping
* criterion. This might be desirable when the stopping criterion is already contained in the iterator definition.
* Builds a set of chains from the current set of ViewEdges.
* Each ViewEdge of the current list potentially starts a new chain. The chaining operator then iterates over
* the ViewEdges of the ViewMap using the user specified iterator.
* This operator iterates both using the increment and decrement operators and is therefore bidirectional.
* This operator works with a ChainingIterator which contains the chaining rules. It is this last one which can be
* told to chain only edges that belong to the selection or not to process twice a ViewEdge during the chaining.
* Each time a ViewEdge is added to a chain, its chaining time stamp is incremented. This allows you to keep track
* of the number of chains to which a ViewEdge belongs to.
* \param it:
* The ChainingIterator on the ViewEdges of the ViewMap. It contains the chaining rule.
/*! The only difference with the above bidirectional chaining algorithm is that we don't need to
* pass a stopping criterion. This might be desirable when the stopping criterion is already
* contained in the iterator definition. Builds a set of chains from the current set of
* ViewEdges. Each ViewEdge of the current list potentially starts a new chain. The chaining
* operator then iterates over the ViewEdges of the ViewMap using the user specified iterator.
* This operator iterates both using the increment and decrement operators and is therefore
* bidirectional. This operator works with a ChainingIterator which contains the chaining rules.
* It is this last one which can be told to chain only edges that belong to the selection or not
* to process twice a ViewEdge during the chaining. Each time a ViewEdge is added to a chain, its
* chaining time stamp is incremented. This allows you to keep track of the number of chains to
* which a ViewEdge belongs to. \param it: The ChainingIterator on the ViewEdges of the ViewMap.
* It contains the chaining rule.
*/
static int bidirectionalChain(ChainingIterator &it);
/*! Splits each chain of the current set of chains in a sequential way.
* The points of each chain are processed (with a specified sampling) sequentially.
* Each time a user specified starting condition is verified, a new chain begins and ends as soon as a
* user-defined stopping predicate is verified.
* This allows chains overlapping rather than chains partitioning.
* The first point of the initial chain is the first point of one of the resulting chains.
* The splitting ends when no more chain can start.
* \param startingPred:
* Each time a user specified starting condition is verified, a new chain begins and ends as
* soon as a user-defined stopping predicate is verified. This allows chains overlapping rather
* than chains partitioning. The first point of the initial chain is the first point of one of
* the resulting chains. The splitting ends when no more chain can start. \param startingPred:
* The predicate on a point that expresses the starting condition
* \param stoppingPred:
* The predicate on a point that expresses the stopping condition
* \param sampling:
* The resolution used to sample the chain for the predicates evaluation. (The chain is not actually
* resampled, a virtual point only progresses along the curve using this resolution)
* The resolution used to sample the chain for the predicates evaluation. (The chain is
* not actually resampled, a virtual point only progresses along the curve using this resolution)
*/
static int sequentialSplit(UnaryPredicate0D &startingPred,
UnaryPredicate0D &stoppingPred,
float sampling = 0.0f);
/*! Splits each chain of the current set of chains in a sequential way.
* The points of each chain are processed (with a specified sampling) sequentially and each time a user
* specified condition is verified, the chain is split into two chains.
* The resulting set of chains is a partition of the initial chain
* \param pred:
* The predicate on a point that expresses the splitting condition
* \param sampling:
* The resolution used to sample the chain for the predicate evaluation. (The chain is not actually
* resampled, a virtual point only progresses along the curve using this resolution)
* The points of each chain are processed (with a specified sampling) sequentially and each time
* a user specified condition is verified, the chain is split into two chains. The resulting set
* of chains is a partition of the initial chain \param pred: The predicate on a point that
* expresses the splitting condition \param sampling: The resolution used to sample the chain for
* the predicate evaluation. (The chain is not actually resampled, a virtual point only
* progresses along the curve using this resolution)
*/
static int sequentialSplit(UnaryPredicate0D &pred, float sampling = 0.0f);
/*! Splits the current set of chains in a recursive way.
* We process the points of each chain (with a specified sampling) to find the point minimizing a specified
* function. The chain is split in two at this point and the two new chains are processed in the same way.
* The recursivity level is controlled through a predicate 1D that expresses a stopping condition
* on the chain that is about to be processed.
* \param func:
* The Unary Function evaluated at each point of the chain.
* The splitting point is the point minimizing this function
* \param pred:
* The Unary Predicate ex pressing the recursivity stopping condition.
* This predicate is evaluated for each curve before it actually gets split.
* If pred(chain) is true, the curve won't be split anymore.
* \param sampling:
* The resolution used to sample the chain for the predicates evaluation. (The chain is not actually
* resampled, a virtual point only progresses along the curve using this resolution)
* We process the points of each chain (with a specified sampling) to find the point minimizing
* a specified function. The chain is split in two at this point and the two new chains are
* processed in the same way. The recursivity level is controlled through a predicate 1D that
* expresses a stopping condition on the chain that is about to be processed. \param func: The
* Unary Function evaluated at each point of the chain. The splitting point is the point
* minimizing this function \param pred: The Unary Predicate ex pressing the recursivity stopping
* condition. This predicate is evaluated for each curve before it actually gets split. If
* pred(chain) is true, the curve won't be split anymore. \param sampling: The resolution used to
* sample the chain for the predicates evaluation. (The chain is not actually resampled, a
* virtual point only progresses along the curve using this resolution)
*/
static int recursiveSplit(UnaryFunction0D<double> &func,
UnaryPredicate1D &pred,
float sampling = 0);
/*! Splits the current set of chains in a recursive way.
* We process the points of each chain (with a specified sampling) to find the point minimizing a specified
* function. The chain is split in two at this point and the two new chains are processed in the same way.
* The user can specify a 0D predicate to make a first selection on the points that can potentially be split.
* A point that doesn't verify the 0D predicate won't be candidate in realizing the min.
* The recursivity level is controlled through a predicate 1D that expresses a stopping condition
* on the chain that is about to be processed.
* \param func:
* We process the points of each chain (with a specified sampling) to find the point minimizing
* a specified function. The chain is split in two at this point and the two new chains are
* processed in the same way. The user can specify a 0D predicate to make a first selection on
* the points that can potentially be split. A point that doesn't verify the 0D predicate won't
* be candidate in realizing the min. The recursivity level is controlled through a predicate 1D
* that expresses a stopping condition on the chain that is about to be processed. \param func:
* The Unary Function evaluated at each point of the chain.
* The splitting point is the point minimizing this function
* \param pred0d:
* The Unary Predicate 0D used to select the candidate points where the split can occur.
* For example, it is very likely that would rather have your chain splitting around its middle point
* than around one of its extremities. A 0D predicate working on the curvilinear abscissa allows
* to add this kind of constraints.
* \param pred:
* The Unary Predicate ex pressing the recursivity stopping condition.
* This predicate is evaluated for each curve before it actually gets split.
* If pred(chain) is true, the curve won't be split anymore.
* \param sampling:
* The resolution used to sample the chain for the predicates evaluation. (The chain is not actually
* resampled, a virtual point only progresses along the curve using this resolution)
* The Unary Predicate 0D used to select the candidate points where the split can
* occur. For example, it is very likely that would rather have your chain splitting around its
* middle point than around one of its extremities. A 0D predicate working on the curvilinear
* abscissa allows to add this kind of constraints. \param pred: The Unary Predicate ex pressing
* the recursivity stopping condition. This predicate is evaluated for each curve before it
* actually gets split. If pred(chain) is true, the curve won't be split anymore. \param
* sampling: The resolution used to sample the chain for the predicates evaluation. (The chain is
* not actually resampled, a virtual point only progresses along the curve using this resolution)
*/
static int recursiveSplit(UnaryFunction0D<double> &func,
UnaryPredicate0D &pred0d,
UnaryPredicate1D &pred,
float sampling = 0.0f);
/*! Sorts the current set of chains (or viewedges) according to the comparison predicate given as argument.
* \param pred:
* The binary predicate used for the comparison
/*! Sorts the current set of chains (or viewedges) according to the comparison predicate given as
* argument. \param pred: The binary predicate used for the comparison
*/
static int sort(BinaryPredicate1D &pred);

View File

@ -70,8 +70,8 @@ void PSStrokeRenderer::RenderStrokeRepBasic(StrokeRep *iStrokeRep) const
svRep[2] = *(v[2]);
color[0] = svRep[0]->color();
//color[1] = svRep[1]->color();
//color[2] = svRep[2]->color();
// color[1] = svRep[1]->color();
// color[2] = svRep[2]->color();
_ofstream << "newpath" << endl;
_ofstream << (color[0])[0] << " " << (color[0])[1] << " " << (color[0])[2] << " setrgbcolor"

View File

@ -65,8 +65,8 @@ class UnaryPredicate0D {
/*! The () operator. Must be overload by inherited classes.
* \param it:
* The Interface0DIterator pointing onto the Interface0D at which we wish to evaluate the predicate.
* \return true if the condition is satisfied, false otherwise.
* The Interface0DIterator pointing onto the Interface0D at which we wish to evaluate the
* predicate. \return true if the condition is satisfied, false otherwise.
*/
virtual int operator()(Interface0DIterator &it);

View File

@ -183,8 +183,8 @@ class FalseUP1D : public UnaryPredicate1D {
};
// QuantitativeInvisibilityUP1D
/*! Returns true if the Quantitative Invisibility evaluated at an Interface1D, using the QuantitativeInvisibilityF1D
* functor, equals a certain user-defined value.
/*! Returns true if the Quantitative Invisibility evaluated at an Interface1D, using the
* QuantitativeInvisibilityF1D functor, equals a certain user-defined value.
*/
class QuantitativeInvisibilityUP1D : public UnaryPredicate1D {
public:
@ -344,7 +344,8 @@ class EqualToChainingTimeStampUP1D : public UnaryPredicate1D {
};
// ShapeUP1D
/*! Returns true if the shape to which the Interface1D belongs to has the same Id as the one specified by the user. */
/*! Returns true if the shape to which the Interface1D belongs to has the same Id as the one
* specified by the user. */
class ShapeUP1D : public UnaryPredicate1D {
private:
Id _id;
@ -487,7 +488,8 @@ class FalseBP1D : public BinaryPredicate1D {
};
// Length2DBP1D
/*! Returns true if the 2D length of the Interface1D i1 is less than the 2D length of the Interface1D i2. */
/*! Returns true if the 2D length of the Interface1D i1 is less than the 2D length of the
* Interface1D i2. */
class Length2DBP1D : public BinaryPredicate1D {
public:
/*! Returns the string "Length2DBP1D" */
@ -538,7 +540,8 @@ class SameShapeIdBP1D : public BinaryPredicate1D {
};
// ViewMapGradientNormBP1D
/*! Returns true if the evaluation of the Gradient norm Function is higher for Interface1D i1 than for i2. */
/*! Returns true if the evaluation of the Gradient norm Function is higher for Interface1D i1 than
* for i2. */
class ViewMapGradientNormBP1D : public BinaryPredicate1D {
private:
Functions1D::GetViewMapGradientNormF1D _func;

View File

@ -38,7 +38,7 @@ class QInformationMap : public InformationMap {
QInformationMap(const QInformationMap &);
QInformationMap &operator=(const QInformationMap &);
//float getSmoothedPixel(int x, int y, float sigma = 0.2f);1
// float getSmoothedPixel(int x, int y, float sigma = 0.2f);1
virtual float getMean(int x, int y);
virtual void retrieveMeanAndVariance(int x, int y, float &oMean, float &oVariance);

View File

@ -484,7 +484,7 @@ void Stroke::setLength(float iLength)
float Stroke::ComputeSampling(int iNVertices)
{
if (iNVertices <= (int)_Vertices.size()) //soc
if (iNVertices <= (int)_Vertices.size()) // soc
return _sampling;
float sampling = _Length / (float)(iNVertices - _Vertices.size() + 1);
@ -563,7 +563,7 @@ int Stroke::Resample(int iNPoints)
if (s->_resampled == false) {
if ((!checkEveryone) && (s->_length < meanlength))
continue;
//resample
// resample
s->_n = s->_n + 1;
s->_sampling = s->_length / (float)(s->_n + 1);
s->_resampled = resampled = true;
@ -577,10 +577,11 @@ int Stroke::Resample(int iNPoints)
checkEveryone = true;
}
if (N < NPointsToAdd) {
// fatal error, likely because _Length is inconsistent with the stroke length computed with the vertices
// fatal error, likely because _Length is inconsistent with the stroke length computed with the
// vertices
return -1;
}
//actually resample:
// actually resample:
for (vector<StrokeSegment>::iterator s = strokeSegments.begin(), send = strokeSegments.end();
s != send;
++s) {
@ -617,7 +618,7 @@ int Stroke::Resample(int iNPoints)
int Stroke::Resample(float iSampling)
{
//cerr << "old size :" << strokeVerticesSize() << endl;
// cerr << "old size :" << strokeVerticesSize() << endl;
if (iSampling == 0)
return 0;
if (iSampling >= _sampling)
@ -625,7 +626,7 @@ int Stroke::Resample(float iSampling)
_sampling = iSampling;
// Resample...
//real curvilinearLength = 0.0f;
// real curvilinearLength = 0.0f;
vertex_container newVertices;
real t = 0.0f;
const real limit = 0.99;
@ -641,17 +642,17 @@ int Stroke::Resample(float iSampling)
Vec2r vec_tmp(b - a);
real norm_var = vec_tmp.norm();
if (norm_var <= _sampling) {
//curvilinearLength += norm_var;
// curvilinearLength += norm_var;
++it;
++next;
continue;
}
//curvilinearLength += _sampling;
// curvilinearLength += _sampling;
t = _sampling / norm_var;
while (t < limit) {
newVertex = new StrokeVertex(&(*it), &(*next), t);
//newVertex->setCurvilinearAbscissa(curvilinearLength);
// newVertex->setCurvilinearAbscissa(curvilinearLength);
newVertices.push_back(newVertex);
t = t + _sampling / norm_var;
}
@ -798,7 +799,7 @@ Stroke::vertex_iterator Stroke::vertices_begin(float sampling)
if ((sampling != 0) && (sampling < _sampling))
Resample(sampling);
return vertex_iterator(_Vertices.begin(), _Vertices.begin(), _Vertices.end());
//return _Vertices.begin();
// return _Vertices.begin();
}
#if 0

View File

@ -143,8 +143,8 @@ class StrokeAttribute {
}
/*! Returns the attribute's thickness.
* \return an array of 2 floats. the first value is the thickness on the right of the vertex when following
* the stroke, the second one is the thickness on the left.
* \return an array of 2 floats. the first value is the thickness on the right of the vertex
* when following the stroke, the second one is the thickness on the left.
*/
inline const float *getThickness() const
{
@ -163,7 +163,8 @@ class StrokeAttribute {
return _thickness[1];
}
/*! Returns the thickness on the right and on the left of the vertex when following the stroke. */
/*! Returns the thickness on the right and on the left of the vertex when following the stroke.
*/
inline Vec2f getThicknessRL() const
{
return Vec2f(_thickness[0], _thickness[1]);
@ -462,8 +463,8 @@ class StrokeVertex : public CurvePoint {
_CurvilignAbscissa = iAbscissa;
}
/*! sets the Stroke's length (it's only a value stored by the Stroke Vertex, it won't change the real
* Stroke's length.)
/*! sets the Stroke's length (it's only a value stored by the Stroke Vertex, it won't change the
* real Stroke's length.)
*/
inline void setStrokeLength(float iLength)
{
@ -498,7 +499,8 @@ class StrokeVertexIterator;
/*! Class to define a stroke.
* A stroke is made of a set of 2D vertices (StrokeVertex), regularly spaced out.
* This set of vertices defines the stroke's backbone geometry.
* Each of these stroke vertices defines the stroke's shape and appearance at this vertex position.
* Each of these stroke vertices defines the stroke's shape and appearance at this vertex
* position.
*/
class Stroke : public Interface1D {
public: // Implementation of Interface1D
@ -532,7 +534,7 @@ class Stroke : public Interface1D {
const_vertex_iterator;
public:
//typedef StrokeVertex vertex_type;
// typedef StrokeVertex vertex_type;
private:
vertex_container _Vertices; //! The stroke's backbone vertices
@ -575,8 +577,8 @@ class Stroke : public Interface1D {
Stroke &operator=(const Stroke &iBrother);
/*! Compute the sampling needed to get iNVertices vertices.
* If the specified number of vertices is less than the actual number of vertices, the actual sampling value
* is returned. (To remove Vertices, use the RemoveVertex() method of this class).
* If the specified number of vertices is less than the actual number of vertices, the actual
* sampling value is returned. (To remove Vertices, use the RemoveVertex() method of this class).
* \param iNVertices:
* The number of StrokeVertices we eventually want in our Stroke.
* \return the sampling that must be used in the Resample(float) method.
@ -586,11 +588,10 @@ class Stroke : public Interface1D {
float ComputeSampling(int iNVertices);
/*! Resampling method.
* Resamples the curve so that it eventually has iNPoints. That means it is going to add iNPoints-vertices_size,
* if vertices_size is the number of points we already have.
* If vertices_size >= iNPoints, no resampling is done.
* \param iNPoints:
* The number of vertices we eventually want in our stroke.
* Resamples the curve so that it eventually has iNPoints. That means it is going to add
* iNPoints-vertices_size, if vertices_size is the number of points we already have. If
* vertices_size >= iNPoints, no resampling is done. \param iNPoints: The number of vertices we
* eventually want in our stroke.
*/
int Resample(int iNPoints);
@ -838,11 +839,9 @@ class Stroke : public Interface1D {
const_vertex_iterator vertices_end() const;
vertex_iterator vertices_end();
/*! Returns a StrokeVertexIterator pointing on the first StrokeVertex of the Stroke. One can specify a sampling
* value to resample the Stroke on the fly if needed.
* \param t:
* The resampling value with which we want our Stroke to be resampled.
* If 0 is specified, no resampling is done.
/*! Returns a StrokeVertexIterator pointing on the first StrokeVertex of the Stroke. One can
* specify a sampling value to resample the Stroke on the fly if needed. \param t: The resampling
* value with which we want our Stroke to be resampled. If 0 is specified, no resampling is done.
*/
StrokeInternal::StrokeVertexIterator strokeVerticesBegin(float t = 0.0f);

View File

@ -51,7 +51,7 @@ class vertex_iterator_base : public IteratorBase<Traits, BidirectionalIteratorTa
typedef vertex_iterator_base<vertex_nonconst_traits> iterator;
typedef vertex_iterator_base<vertex_const_traits> const_iterator;
//protected:
// protected:
public:
vertex_container_iterator _it;
vertex_container_iterator _begin;
@ -59,7 +59,7 @@ class vertex_iterator_base : public IteratorBase<Traits, BidirectionalIteratorTa
public:
friend class Stroke;
//friend class vertex_iterator;
// friend class vertex_iterator;
inline vertex_iterator_base() : parent_class()
{
@ -79,7 +79,7 @@ class vertex_iterator_base : public IteratorBase<Traits, BidirectionalIteratorTa
_end = iBrother._end;
}
//protected: //FIXME
// protected: //FIXME
public:
inline vertex_iterator_base(vertex_container_iterator it,
vertex_container_iterator begin,

Some files were not shown because too many files have changed in this diff Show More