some cleanups

This commit is contained in:
alemuntoni 2021-03-25 18:13:41 +01:00
parent c8149ca991
commit ade2c49443
7 changed files with 178 additions and 175 deletions

View File

@ -25,6 +25,8 @@
#define __VCG_COMPLEX_BASE #define __VCG_COMPLEX_BASE
#include <typeindex> #include <typeindex>
#include <set>
#include <vcg/container/simple_temporary_data.h> #include <vcg/container/simple_temporary_data.h>
#include "used_types.h" #include "used_types.h"
@ -599,7 +601,7 @@ template <class MeshType> inline bool IsMarked(const MeshType & m,typename MeshT
@param m the mesh containing the element @param m the mesh containing the element
@param t tetra pointer */ @param t tetra pointer */
template <class MeshType> template <class MeshType>
inline bool IsMarked(MeshType &m, typename MeshType::ConstTetraPointer t) { return t->cIMark() == m.imark; } inline bool IsMarked(const MeshType &m, typename MeshType::ConstTetraPointer t) { return t->cIMark() == m.imark; }
/** \brief Set the vertex incremental mark of the vertex to the one of the mesh. /** \brief Set the vertex incremental mark of the vertex to the one of the mesh.
@param m the mesh containing the element @param m the mesh containing the element

View File

@ -49,7 +49,7 @@ First working release.
#ifndef __VCGLIB_BOX #ifndef __VCGLIB_BOX
#define __VCGLIB_BOX #define __VCGLIB_BOX
#include <vcg/space/point.h> #include <vcg/space/point3.h>
#include <vcg/space/space.h> #include <vcg/space/space.h>
#include <vcg/math/linear.h> #include <vcg/math/linear.h>

View File

@ -2,7 +2,7 @@
* VCGLib o o * * VCGLib o o *
* Visual and Computer Graphics Library o o * * Visual and Computer Graphics Library o o *
* _ O _ * * _ O _ *
* Copyright(C) 2004-2016 \/)\/ * * Copyright(C) 2004-2021 \/)\/ *
* Visual Computing Lab /\/| * * Visual Computing Lab /\/| *
* ISTI - Italian National Research Council | * * ISTI - Italian National Research Council | *
* \ * * \ *
@ -43,47 +43,44 @@ template <class BoxScalarType>
class Box2 class Box2
{ {
public: public:
/// The scalar type /// The scalar type
typedef BoxScalarType ScalarType; typedef BoxScalarType ScalarType;
typedef Point2<BoxScalarType> PointType ; typedef Point2<BoxScalarType> PointType;
/// min coordinate point /// min coordinate point
PointType min; PointType min;
/// max coordinate point /// max coordinate point
PointType max; PointType max;
/// Standard constructor /// Standard constructor
inline Box2() { min.X()= 1; max.X()= -1; min.Y()= 1; max.Y()= -1; } inline Box2() { min.X()= 1; max.X()= -1; min.Y()= 1; max.Y()= -1; }
/// Copy constructor /// Min Max constructor
inline Box2( const Box2 & b ) { min=b.min; max=b.max; } inline Box2(const Point2<BoxScalarType> & mi, const Point2<BoxScalarType> & ma ) { min = mi; max = ma; }
/// Min Max constructor
inline Box2( const Point2<BoxScalarType> & mi, const Point2<BoxScalarType> & ma ) { min = mi; max = ma; }
inline Box2(const Point2<BoxScalarType> & center, const BoxScalarType & radius) { inline Box2(const Point2<BoxScalarType> & center, const BoxScalarType & radius)
min = center-Point2<BoxScalarType>(radius,radius); {
max = center+Point2<BoxScalarType>(radius,radius); min = center-Point2<BoxScalarType>(radius,radius);
} max = center+Point2<BoxScalarType>(radius,radius);
}
/// Distructor /// Operator to compare two bounding box
inline ~Box2() { }
/// Operator to compare two bounding box
inline bool operator == ( Box2 const & p ) const inline bool operator == ( Box2 const & p ) const
{ {
return min==p.min && max==p.max; return min==p.min && max==p.max;
} }
/// Initializing the bounding box with a point /// Initializing the bounding box with a point
void Set( const PointType & p ) void Set( const PointType & p )
{ {
min = max = p; min = max = p;
} }
Point2<BoxScalarType> P(const int & i) const Point2<BoxScalarType> P(int i) const
{ {
return Point2<BoxScalarType>( return Point2<BoxScalarType>(
min[0]+ (i%2) * DimX(), min[0]+ (i%2) * DimX(),
min[1]+ ((i / 2)%2) * DimY()); min[1]+ ((i / 2)%2) * DimY());
} }
// Initializing with the values // Initializing with the values
inline void Set( ScalarType minx, ScalarType miny, ScalarType maxx, ScalarType maxy ) inline void Set( ScalarType minx, ScalarType miny, ScalarType maxx, ScalarType maxy )
{ {
min[0] = minx; min[0] = minx;
@ -91,15 +88,15 @@ public:
max[0] = maxx; max[0] = maxx;
max[1] = maxy; max[1] = maxy;
} }
/// Set the bounding box to a null value /// Set the bounding box to a null value
void SetNull() void SetNull()
{ {
min.X()= 1; max.X()= -1; min.Y()= 1; max.Y()= -1; min.X()= 1; max.X()= -1; min.Y()= 1; max.Y()= -1;
} }
/** Function to add two bounding box /** @brief Function to add two bounding box
the bounding box expand to include the other bounding box (if necessary) * the bounding box expand to include the other bounding box (if necessary)
@param b The bounding box to be added * @param b The bounding box to be added
*/ */
void Add( Box2 const & b ) void Add( Box2 const & b )
{ {
if(IsNull()) if(IsNull())
@ -116,10 +113,11 @@ public:
if(max.Y() < b.max.Y()) max.Y() = b.max.Y(); if(max.Y() < b.max.Y()) max.Y() = b.max.Y();
} }
} }
/** Adds a point to the bouning box. /**
the bounding box expand to include the new point (if necessary) * @brief Adds a point to the bouning box.
@param p The point 2D * the bounding box expand to include the new point (if necessary)
*/ * @param p The point 2D
*/
void Add( const PointType & p ) void Add( const PointType & p )
{ {
if(IsNull()) Set(p); if(IsNull()) Set(p);
@ -133,26 +131,29 @@ public:
} }
} }
/** Varies the dimension of the bounding box. /**
@param delta The size delta (if positive, box is enlarged) * @brief Varies the dimension of the bounding box.
*/ * @param delta The size delta (if positive, box is enlarged)
void Offset(const ScalarType s) */
void Offset(ScalarType s)
{ {
Offset(PointType(s, s)); Offset(PointType(s, s));
} }
/** Varies the dimension of the bounding box. /**
@param delta The size delta per dimension (if positive, box is enlarged) * @brief Varies the dimension of the bounding box.
*/ * @param delta The size delta per dimension (if positive, box is enlarged)
*/
void Offset(const PointType & delta) void Offset(const PointType & delta)
{ {
min -= delta; min -= delta;
max += delta; max += delta;
} }
/** Computes intersection between this and another bounding box /**
@param b The other bounding box * @brief Computes intersection between this and another bounding box
*/ * @param b The other bounding box
*/
void Intersect( const Box2 & b ) void Intersect( const Box2 & b )
{ {
if(min.X() < b.min.X()) min.X() = b.min.X(); if(min.X() < b.min.X()) min.X() = b.min.X();
@ -164,86 +165,90 @@ public:
if(min.X()>max.X() || min.Y()>max.Y()) SetNull(); if(min.X()>max.X() || min.Y()>max.Y()) SetNull();
} }
/** Translate the bounding box by a vector /**
@param p The translation vector * @brief Translate the bounding box by a vector
*/ * @param p The translation vector
*/
void Translate( const PointType & p ) void Translate( const PointType & p )
{ {
min += p; min += p;
max += p; max += p;
} }
/** Checks whether a 2D point p is inside the box /**
@param p The point 2D * @brief Checks whether a 2D point p is inside the box
@return True iff p inside * @param p The point 2D
*/ * @return True iff p inside
bool IsIn( PointType const & p ) const */
bool IsIn( const PointType & p ) const
{ {
return ( return (
min.X() <= p.X() && p.X() <= max.X() && min.X() <= p.X() && p.X() <= max.X() &&
min.Y() <= p.Y() && p.Y() <= max.Y() min.Y() <= p.Y() && p.Y() <= max.Y());
);
} }
/** Checks whether a 2D point p is inside the box, closed at min but open at max /**
@param p The point in 2D * @brief Checks whether a 2D point p is inside the box, closed at min but open at max
@return True iff p inside * @param p The point in 2D
*/ * @return True iff p inside
bool IsInEx( PointType const & p ) const */
bool IsInEx( const PointType & p ) const
{ {
return ( return (
min.X() <= p.X() && p.X() < max.X() && min.X() <= p.X() && p.X() < max.X() &&
min.Y() <= p.Y() && p.Y() < max.Y() min.Y() <= p.Y() && p.Y() < max.Y());
);
} }
/** Check bbox collision. /**
Note: just adjiacent bbox won't collide * @brief Check bbox collision.
@param b A bounding box * Note: just adjiacent bbox won't collide
@return True iff collision * @param b A bounding box
*/ * @return True iff collision
bool Collide( Box2 const &b ) */
bool Collide( const Box2 &b ) const
{ {
Box2 bb=*this; Box2 bb=*this;
bb.Intersect(b); bb.Intersect(b);
return bb.IsValid(); return bb.IsValid();
} }
/** Check if empty. /**
@return True iff empty * Check if empty.
*/ * @return True iff empty
*/
inline bool IsNull() const { return min.X()>max.X() || min.Y()>max.Y(); } inline bool IsNull() const { return min.X()>max.X() || min.Y()>max.Y(); }
/** Check consistency. /**
@return True iff consistent * Check consistency.
*/ * @return True iff consistent
*/
inline bool IsValid() const { return min.X()<max.X() && min.Y()<max.Y(); } inline bool IsValid() const { return min.X()<max.X() && min.Y()<max.Y(); }
/** Check if empty. /** Check if empty.
@return True iff empty @return True iff empty
*/ */
inline bool IsEmpty() const { return min==max; } inline bool IsEmpty() const { return min==max; }
/// Computes length of diagonal /// Computes length of diagonal
ScalarType Diag() const ScalarType Diag() const
{ {
return Distance(min,max); return Distance(min,max);
} }
/// Computes box center /// Computes box center
PointType Center() const PointType Center() const
{ {
return (min+max)/2; return (min+max)/2;
} }
/// Computes area /// Computes area
inline ScalarType Area() const inline ScalarType Area() const
{ {
return (max[0]-min[0])*(max[1]-min[1]); return (max[0]-min[0])*(max[1]-min[1]);
} }
/// computes dimension on X axis. /// computes dimension on X axis.
inline ScalarType DimX() const { return max.X()-min.X(); } inline ScalarType DimX() const { return max.X()-min.X(); }
/// computes dimension on Y axis. /// computes dimension on Y axis.
inline ScalarType DimY() const { return max.Y()-min.Y(); } inline ScalarType DimY() const { return max.Y()-min.Y(); }
/// Computes sizes (as a vector) /// Computes sizes (as a vector)
inline PointType Dim() const { return max-min; } inline PointType Dim() const { return max-min; }
/// Deprecated: use GlobalToLocal /// Deprecated: use GlobalToLocal
inline void Normalize( PointType & p ) inline void Normalize( PointType & p )
{ {
p -= min; p -= min;
@ -251,27 +256,27 @@ public:
p[1] /= max[1]-min[1]; p[1] /= max[1]-min[1];
} }
/// Returns global coords of a local point expressed in [0..1]^2 /// Returns global coords of a local point expressed in [0..1]^2
PointType LocalToGlobal(PointType const & p) const{ PointType LocalToGlobal(const PointType & p) const{
return PointType( return PointType(
min[0] + p[0]*(max[0]-min[0]), min[0] + p[0]*(max[0]-min[0]),
min[1] + p[1]*(max[1]-min[1])); min[1] + p[1]*(max[1]-min[1]));
} }
/// Returns local coords expressed in [0..1]^2 of a point in R^2 /// Returns local coords expressed in [0..1]^2 of a point in R^2
PointType GlobalToLocal(PointType const & p) const{ PointType GlobalToLocal(const PointType & p) const{
return PointType( return PointType(
(p[0]-min[0])/(max[0]-min[0]), (p[0]-min[0])/(max[0]-min[0]),
(p[1]-min[1])/(max[1]-min[1]) (p[1]-min[1])/(max[1]-min[1])
); );
} }
/// Turns the bounding box into a square (conservatively) /// Turns the bounding box into a square (conservatively)
void MakeSquare(){ void MakeSquare(){
ScalarType radius = max( DimX(), DimY() ) / 2; ScalarType radius = max( DimX(), DimY() ) / 2;
PointType c = Center(); PointType c = Center();
max = c + PointType(radius, radius); max = c + PointType(radius, radius);
min = c - PointType(radius, radius); min = c - PointType(radius, radius);
} }
inline unsigned char MaxDim() const { inline unsigned char MaxDim() const {
int i=1; int i=1;
@ -300,36 +305,36 @@ ScalarType DistancePoint2Box2(const Point2<ScalarType> &test,
if ((test.X()<=bbox.min.X())&&(test.Y()<=bbox.min.Y())) if ((test.X()<=bbox.min.X())&&(test.Y()<=bbox.min.Y()))
return ((test-bbox.min).Norm()); return ((test-bbox.min).Norm());
else else
if ((test.X()>=bbox.min.X())&& if ((test.X()>=bbox.min.X())&&
(test.X()<=bbox.max.X())&& (test.X()<=bbox.max.X())&&
(test.Y()<=bbox.min.Y())) (test.Y()<=bbox.min.Y()))
return (bbox.min.Y()-test.Y()); return (bbox.min.Y()-test.Y());
else else
if ((test.X()>=bbox.max.X())&& if ((test.X()>=bbox.max.X())&&
(test.Y()<=bbox.min.Y())) (test.Y()<=bbox.min.Y()))
return ((test-vcg::Point2<ScalarType>(bbox.max.X(),bbox.min.Y())).Norm()); return ((test-vcg::Point2<ScalarType>(bbox.max.X(),bbox.min.Y())).Norm());
else else
if ((test.Y()>=bbox.min.Y())&& if ((test.Y()>=bbox.min.Y())&&
(test.Y()<=bbox.max.Y())&& (test.Y()<=bbox.max.Y())&&
(test.X()>=bbox.max.X())) (test.X()>=bbox.max.X()))
return (test.X()-bbox.max.X()); return (test.X()-bbox.max.X());
else else
if ((test.X()>=bbox.max.X())&&(test.Y()>=bbox.max.Y())) if ((test.X()>=bbox.max.X())&&(test.Y()>=bbox.max.Y()))
return ((test-bbox.max).Norm()); return ((test-bbox.max).Norm());
else else
if ((test.X()>=bbox.min.X())&& if ((test.X()>=bbox.min.X())&&
(test.X()<=bbox.max.X())&& (test.X()<=bbox.max.X())&&
(test.Y()>=bbox.max.Y())) (test.Y()>=bbox.max.Y()))
return (test.Y()-bbox.max.Y()); return (test.Y()-bbox.max.Y());
else else
if ((test.X()<=bbox.min.X())&& if ((test.X()<=bbox.min.X())&&
(test.Y()>=bbox.max.Y())) (test.Y()>=bbox.max.Y()))
return ((test-vcg::Point2<ScalarType>(bbox.min.X(),bbox.max.Y())).Norm()); return ((test-vcg::Point2<ScalarType>(bbox.min.X(),bbox.max.Y())).Norm());
else else
if ((test.X()<=bbox.min.X())&& if ((test.X()<=bbox.min.X())&&
(test.Y()<=bbox.max.Y())&& (test.Y()<=bbox.max.Y())&&
(test.Y()>=bbox.min.Y())) (test.Y()>=bbox.min.Y()))
return (bbox.min.X()-test.X()); return (bbox.min.X()-test.X());
} }
else else
{ {
@ -372,13 +377,13 @@ Point2<ScalarType> ClosestPoint2Box2(const Point2<ScalarType> &test,
return closest; return closest;
} }
/// Specificazione di box of short /// Specificazione di box of short
typedef Box2<short> Box2s; typedef Box2<short> Box2s;
/// Specificazione di box of int /// Specificazione di box of int
typedef Box2<int> Box2i; typedef Box2<int> Box2i;
/// Specificazione di box of float /// Specificazione di box of float
typedef Box2<float> Box2f; typedef Box2<float> Box2f;
/// Specificazione di box of double /// Specificazione di box of double
typedef Box2<double> Box2d; typedef Box2<double> Box2d;
/*@}*/ /*@}*/

View File

@ -46,29 +46,27 @@ public:
typedef BoxScalarType ScalarType; typedef BoxScalarType ScalarType;
/// min coordinate point /// min coordinate point
Point3<BoxScalarType> min; Point3<BoxScalarType> min;
/// max coordinate point /// max coordinate point
Point3<BoxScalarType> max; Point3<BoxScalarType> max;
/// The bounding box constructor /// The bounding box constructor
inline Box3() { this->SetNull(); } inline Box3() { this->SetNull(); }
/// Copy constructor
//inline Box3( const Box3 & b ) { min=b.min; max=b.max; }
/// Min Max constructor /// Min Max constructor
inline Box3( const Point3<BoxScalarType> & mi, const Point3<BoxScalarType> & ma ) { min = mi; max = ma; } inline Box3( const Point3<BoxScalarType> & mi, const Point3<BoxScalarType> & ma ) { min = mi; max = ma; }
/// Point Radius Constructor /// Point Radius Constructor
inline Box3(const Point3<BoxScalarType> & center, const BoxScalarType & radius) { inline Box3(const Point3<BoxScalarType> & center, const BoxScalarType & radius) {
min = center-Point3<BoxScalarType>(radius,radius,radius); min = center-Point3<BoxScalarType>(radius,radius,radius);
max = center+Point3<BoxScalarType>(radius,radius,radius); max = center+Point3<BoxScalarType>(radius,radius,radius);
} }
/// The bounding box distructor /// The bounding box distructor
inline ~Box3() { } inline ~Box3() { }
/// Operator to compare two bounding box /// Operator to compare two bounding box
inline bool operator == ( Box3<BoxScalarType> const & p ) const inline bool operator == ( const Box3<BoxScalarType> & p ) const
{ {
return min==p.min && max==p.max; return min==p.min && max==p.max;
} }
/// Operator to dispare two bounding box /// Operator to dispare two bounding box
inline bool operator != ( Box3<BoxScalarType> const & p ) const inline bool operator != ( const Box3<BoxScalarType> & p ) const
{ {
return min!=p.min || max!=p.max; return min!=p.min || max!=p.max;
} }
@ -103,7 +101,7 @@ public:
/** Modify the current bbox to contain also the passed box. /** Modify the current bbox to contain also the passed box.
* Adding a null bounding box does nothing * Adding a null bounding box does nothing
*/ */
void Add( Box3<BoxScalarType> const & b ) void Add( const Box3<BoxScalarType> & b )
{ {
if(b.IsNull()) return; // Adding a null bbox should do nothing if(b.IsNull()) return; // Adding a null bbox should do nothing
if(IsNull()) *this=b; if(IsNull()) *this=b;
@ -137,20 +135,20 @@ public:
/** Modify the current bbox to contain also the passed sphere /** Modify the current bbox to contain also the passed sphere
*/ */
void Add( const Point3<BoxScalarType> & p, const BoxScalarType radius ) void Add( const Point3<BoxScalarType> & p, const BoxScalarType radius )
{
if(IsNull()) Set(p);
else
{ {
min.X() = std::min(min.X(),p.X()-radius); if(IsNull()) Set(p);
min.Y() = std::min(min.Y(),p.Y()-radius); else
min.Z() = std::min(min.Z(),p.Z()-radius); {
min.X() = std::min(min.X(),p.X()-radius);
min.Y() = std::min(min.Y(),p.Y()-radius);
min.Z() = std::min(min.Z(),p.Z()-radius);
max.X() = std::max(max.X(),p.X()+radius); max.X() = std::max(max.X(),p.X()+radius);
max.Y() = std::max(max.Y(),p.Y()+radius); max.Y() = std::max(max.Y(),p.Y()+radius);
max.Z() = std::max(max.Z(),p.Z()+radius); max.Z() = std::max(max.Z(),p.Z()+radius);
}
} }
}
/** Modify the current bbox to contain also the box b transformed according to the matrix m /** Modify the current bbox to contain also the box b transformed according to the matrix m
*/ */
void Add( const Matrix44<BoxScalarType> &m, const Box3<BoxScalarType> & b ) void Add( const Matrix44<BoxScalarType> &m, const Box3<BoxScalarType> & b )
@ -193,7 +191,7 @@ void Add( const Point3<BoxScalarType> & p, const BoxScalarType radius )
} }
/** true if the point belong to the closed box /** true if the point belong to the closed box
*/ */
bool IsIn( Point3<BoxScalarType> const & p ) const bool IsIn( const Point3<BoxScalarType> & p ) const
{ {
return ( return (
min.X() <= p.X() && p.X() <= max.X() && min.X() <= p.X() && p.X() <= max.X() &&
@ -204,7 +202,7 @@ void Add( const Point3<BoxScalarType> & p, const BoxScalarType radius )
/** true if the point belong to the open box (open on the max side) /** true if the point belong to the open box (open on the max side)
* e.g. if p in [min,max) * e.g. if p in [min,max)
*/ */
bool IsInEx( Point3<BoxScalarType> const & p ) const bool IsInEx( const Point3<BoxScalarType> & p ) const
{ {
return ( return (
min.X() <= p.X() && p.X() < max.X() && min.X() <= p.X() && p.X() < max.X() &&
@ -225,7 +223,7 @@ void Add( const Point3<BoxScalarType> & p, const BoxScalarType radius )
return bb.IsValid(); return bb.IsValid();
} }
*/ */
bool Collide(Box3<BoxScalarType> const &b) const bool Collide( const Box3<BoxScalarType> &b) const
{ {
return b.min.X()<max.X() && b.max.X()>min.X() && return b.min.X()<max.X() && b.max.X()>min.X() &&
b.min.Y()<max.Y() && b.max.Y()>min.Y() && b.min.Y()<max.Y() && b.max.Y()>min.Y() &&
@ -259,14 +257,14 @@ void Add( const Point3<BoxScalarType> & p, const BoxScalarType radius )
return (max-min); return (max-min);
} }
/// Returns global coords of a local point expressed in [0..1]^3 /// Returns global coords of a local point expressed in [0..1]^3
Point3<BoxScalarType> LocalToGlobal(Point3<BoxScalarType> const & p) const{ Point3<BoxScalarType> LocalToGlobal(const Point3<BoxScalarType> & p) const{
return Point3<BoxScalarType>( return Point3<BoxScalarType>(
min[0] + p[0]*(max[0]-min[0]), min[0] + p[0]*(max[0]-min[0]),
min[1] + p[1]*(max[1]-min[1]), min[1] + p[1]*(max[1]-min[1]),
min[2] + p[2]*(max[2]-min[2])); min[2] + p[2]*(max[2]-min[2]));
} }
/// Returns local coords expressed in [0..1]^3 of a point in 3D /// Returns local coords expressed in [0..1]^3 of a point in 3D
Point3<BoxScalarType> GlobalToLocal(Point3<BoxScalarType> const & p) const{ Point3<BoxScalarType> GlobalToLocal(const Point3<BoxScalarType> & p) const{
return Point3<BoxScalarType>( return Point3<BoxScalarType>(
(p[0]-min[0])/(max[0]-min[0]), (p[0]-min[0])/(max[0]-min[0]),
(p[1]-min[1])/(max[1]-min[1]), (p[1]-min[1])/(max[1]-min[1]),
@ -313,7 +311,7 @@ void Add( const Point3<BoxScalarType> & p, const BoxScalarType radius )
} }
/// gives the ith box vertex in order: (x,y,z),(X,y,z),(x,Y,z),(X,Y,z),(x,y,Z),(X,y,Z),(x,Y,Z),(X,Y,Z) /// gives the ith box vertex in order: (x,y,z),(X,y,z),(x,Y,z),(X,Y,z),(x,y,Z),(X,y,Z),(x,Y,Z),(X,Y,Z)
Point3<BoxScalarType> P(const int & i) const { Point3<BoxScalarType> P(int i) const {
return Point3<BoxScalarType>( return Point3<BoxScalarType>(
min[0]+ (i%2) * DimX(), min[0]+ (i%2) * DimX(),
min[1]+ ((i / 2)%2) * DimY(), min[1]+ ((i / 2)%2) * DimY(),

View File

@ -253,7 +253,7 @@ public:
assert(i>=0 && i<3); assert(i>=0 && i<3);
return _v[i]; return _v[i];
} }
inline const P3ScalarType &X() const { return _v[0]; } inline const P3ScalarType &X() const { return _v[0]; }
inline const P3ScalarType &Y() const { return _v[1]; } inline const P3ScalarType &Y() const { return _v[1]; }
inline const P3ScalarType &Z() const { return _v[2]; } inline const P3ScalarType &Z() const { return _v[2]; }
inline P3ScalarType &X() { return _v[0]; } inline P3ScalarType &X() { return _v[0]; }

View File

@ -97,10 +97,8 @@ public:
{ {
_v[0] = p[0]; _v[1]= p[1]; _v[2] = p[2]; _v[3]= p[3]; _v[0] = p[0]; _v[1]= p[1]; _v[2] = p[2]; _v[3]= p[3];
} }
inline Point4 ( const Point4 & p ) inline Point4 ( const Point4 & p ) = default;
{
_v[0]= p._v[0]; _v[1]= p._v[1]; _v[2]= p._v[2]; _v[3]= p._v[3];
}
inline void SetZero() inline void SetZero()
{ {
_v[0] = _v[1] = _v[2] = _v[3]= 0; _v[0] = _v[1] = _v[2] = _v[3]= 0;

View File

@ -167,7 +167,7 @@ public:
Line2 (const Line2<ScalarType,!NORM > &r) Line2 (const Line2<ScalarType,!NORM > &r)
{ Import(r); }; { Import(r); };
/// assignment /// assignment
inline LineType & operator = ( Line2<ScalarType,!NORM> const &r) inline LineType & operator = ( const Line2<ScalarType,!NORM> &r)
{ Import(r); return *this; }; { Import(r); return *this; };
//@} //@}