|
shape_doc 0.1
|
| graphic<C,V>* mmx::shape::as_graphic | ( | const curve_rational< C, V > & | c, |
| unsigned | N = 100 |
||
| ) |
Definition at line 178 of file curve_rational.hpp.
Referenced by as_graphic().
{
typedef typename curve_pl<C,V>::Point Point;
typedef typename curve_pl<C,V>::Edge Edge;
typedef C Scalar;
GRAPHIC* r = new GRAPHIC( GRAPHIC::E_LINE, N+1, 2*N);
Scalar t=c.tmin(),dt=(c.tmax()-c.tmin())/N;
for(unsigned i=0;i<=N;i++) {
Scalar w=c.denominator()(t);
for(unsigned j=0;j<3;j++)
r->vertices[3*i+j]=c.numerator(j)(t)/w;
t+=dt;
}
for(unsigned i=0;i<N;i++) {
r->indices[2*i]=i;
r->indices[2*i+1]=i+1;
}
return r;
}
| graphic<C,V>* mmx::shape::as_graphic | ( | const mesher3d_curve_algebraic< C, V > & | tp | ) |
Definition at line 318 of file mesher3d_curve_algebraic.hpp.
References Edge.
{
typedef typename SELF::Point Point;
typedef typename SELF::Edge Edge;
typedef graphic<C,V> Graphic;
int nbi=0;
if( tp.nbe()>0){
nbi=2*tp.nbe();
int c=0;
Graphic* res = new Graphic( Graphic::E_LINE, nbi, nbi);
foreach(Edge* e, tp.edges()) {
res->vertices[3*c] =e->source()->x();
res->vertices[3*c+1]=e->source()->y();
res->vertices[3*c+2]=e->source()->z();
c++;
res->vertices[3*c] =e->destination()->x();
res->vertices[3*c+1]=e->destination()->y();
res->vertices[3*c+2]=e->destination()->z();
c++;
res->indices[c-2]=c-1;
res->indices[c-1]=c-2;
}
return res;
}
return NULL;
}
| use<tpl3d_def,V>::Graphic* mmx::shape::as_graphic | ( | const tpl3d< C, V > & | tp | ) |
Definition at line 290 of file tpl3d.hpp.
References as_graphic().
{
return use<tpl3d_def,V>::as_graphic(tp);
}
| use<tpl3d_def,V>::Graphic* mmx::shape::as_graphic | ( | const mesher3d_shape< C, V > & | tp | ) |
Definition at line 172 of file mesher3d_shape.hpp.
References as_graphic().
{
return use<tpl3d_def,V>::as_graphic(tp);
}
| T at | ( | list< T > | l, |
| int | p | ||
| ) |
| void mmx::shape::cell3d_split | ( | CELL * | left, |
| CELL * | right, | ||
| CELL * | cl, | ||
| int | v, | ||
| double | s | ||
| ) | [inline] |
Definition at line 555 of file cell3d.hpp.
{
if(v==0) {
left = new CELL(*cl);
right = new CELL(*cl);
left->set_xmax(s);
right->set_xmin(s);
cl->connect0(left,right);
left->join0(right);
} else if (v==1) {
left = new CELL(*cl);
right = new CELL(*cl);
left->set_ymax(s);
right->set_ymin(s);
cl->connect1(left,right);
left->join2(right);
} else if (v==2) {
left = new CELL(*cl);
right = new CELL(*cl);
left->set_zmax(s);
right->set_zmin(s);
cl->connect2(left,right);
left->join2(right);
}
}
| bool mmx::shape::check_overlap | ( | cell2d< C, V > * | a, |
| cell2d< C, V > * | b, | ||
| int | v | ||
| ) | [inline] |
Definition at line 411 of file cell2d.hpp.
Referenced by cell3d< C, V >::connect0(), cell2d< C, V >::connect0(), cell3d< C, V >::connect1(), cell2d< C, V >::connect1(), and cell3d< C, V >::connect2().
{// check if a,b overlap wrt v-th coordinate
if (v==0) //direction v=0
return !( a->xmax()<= b->xmin() ||
b->xmax()<= a->xmin() );
else //direction v=1
return !( a->ymax()<= b->ymin() ||
b->ymax()<= a->ymin() );
}
| bool mmx::shape::check_overlap | ( | cell3d< C, V > * | a, |
| cell3d< C, V > * | b, | ||
| int | v | ||
| ) | [inline] |
Definition at line 539 of file cell3d.hpp.
{// check if a,b overlap wrt v-th coordinate
if (v==0) //direction v=0
return !( a->xmax()<= b->xmin() ||
b->xmax()<= a->xmin() );
if (v==1) //direction v=1
return !( a->ymax()<= b->ymin() ||
b->ymax()<= a->ymin() );
if (v==2) //direction v=2
return !( a->zmax()<= b->zmin() ||
b->zmax()<= a->zmin() );
return false;
}
| mmx::shape::DECLARE_REF_OF | ( | AXEL | , |
| AXEL | |||
| ) |
| mmx::shape::DECLARE_REF_OF | ( | MGXK | , |
| MGXK | |||
| ) |
| mmx::shape::DECLARE_REF_OF | ( | integer | , |
| MGXK | |||
| ) |
| mmx::shape::DECLARE_REF_OF | ( | rational | , |
| MGXK | |||
| ) |
| mmx::shape::DECLARE_REF_OF | ( | floating<> | , |
| MGXK | |||
| ) |
| mmx::shape::DECLARE_REF_OF | ( | with_color< V > | , |
| with_color< REF_OF(V)> | |||
| ) |
| mmx::shape::DECLARE_REF_OF | ( | with_tpl3d< K > | , |
| REF_OF(K) | |||
| ) |
| point<C,V,N>::Scalar mmx::shape::distance | ( | const point< C, V, N > & | p1, |
| const point< C, V, N > & | p2 | ||
| ) | [inline] |
Definition at line 177 of file point.hpp.
Referenced by cell3d_algebraic_curve< C, V >::check_insert().
{
typename SELF::Scalar d=0;
d += (p1.x()-p2.x())*(p1.x()-p2.x());
d += (p1.y()-p2.y())*(p1.y()-p2.y());
d += (p1.z()-p2.z())*(p1.z()-p2.z());
return std::sqrt(d);
}
| bool mmx::shape::eq | ( | const shape::ImplicitCurve & | v1, |
| const shape::ImplicitCurve & | v2 | ||
| ) | [inline] |
Definition at line 30 of file glue_implicit_curve.hpp.
{return v1==v2;}
| bool mmx::shape::exact_eq | ( | const shape::point< C > & | v1, |
| const shape::point< C > & | v2 | ||
| ) | [inline] |
Definition at line 28 of file point_glue.hpp.
{return v1==v2;}
| bool mmx::shape::exact_eq | ( | const shape::point_set< C, shape::with_color< V > > & | v1, |
| const shape::point_set< C, shape::with_color< V > > & | v2 | ||
| ) | [inline] |
Definition at line 23 of file point_set_with_color_glue.hpp.
{return v1==v2;}
| bool mmx::shape::exact_eq | ( | const shape::color< shape::MGXK > & | v1, |
| const shape::color< shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 25 of file color_glue.hpp.
{return v1==v2;}
| bool mmx::shape::exact_eq | ( | const shape::algebraic_curve< rational, shape::MGXK > & | v1, |
| const shape::algebraic_curve< rational, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 31 of file algebraic_curve_glue.hpp.
{return v1==v2;}
| bool mmx::shape::exact_eq | ( | const shape::viewer< shape::axel, K > & | v1, |
| const shape::viewer< shape::axel, K > & | v2 | ||
| ) | [inline] |
Definition at line 21 of file axel_glue.hpp.
{return v1==v2;}
| bool mmx::shape::exact_eq | ( | const shape::bounding_box< double, shape::MGXK > & | v1, |
| const shape::bounding_box< double, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 26 of file bounding_box_glue.hpp.
{return v1==v2;}
| bool mmx::shape::exact_eq | ( | const shape::curve_rational< rational, shape::MGXK > & | v1, |
| const shape::curve_rational< rational, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 39 of file curve_rational_glue.hpp.
{return v1==v2;}
| bool mmx::shape::exact_eq | ( | const shape::surface_algebraic< rational, shape::MGXK > & | v1, |
| const shape::surface_algebraic< rational, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 33 of file surface_algebraic_glue.hpp.
{return v1==v2;}
| unsigned mmx::shape::exact_hash | ( | const shape::algebraic_curve< rational, shape::MGXK > & | m | ) | [inline] |
| unsigned mmx::shape::exact_hash | ( | const shape::bounding_box< double, shape::MGXK > & | m | ) | [inline] |
| unsigned mmx::shape::exact_hash | ( | const shape::viewer< shape::axel, K > & | m | ) | [inline] |
| unsigned mmx::shape::exact_hash | ( | const shape::point< C > & | m | ) | [inline] |
| unsigned mmx::shape::exact_hash | ( | const shape::color< shape::MGXK > & | m | ) | [inline] |
| unsigned mmx::shape::exact_hash | ( | const shape::point_set< C, shape::with_color< V > > & | m | ) | [inline] |
| unsigned mmx::shape::exact_hash | ( | const shape::curve_rational< rational, shape::MGXK > & | m | ) | [inline] |
| unsigned mmx::shape::exact_hash | ( | const shape::surface_algebraic< rational, shape::MGXK > & | m | ) | [inline] |
| bool mmx::shape::exact_neq | ( | const shape::viewer< shape::axel, K > & | v1, |
| const shape::viewer< shape::axel, K > & | v2 | ||
| ) | [inline] |
Definition at line 22 of file axel_glue.hpp.
{return v1!=v2;}
| bool mmx::shape::exact_neq | ( | const shape::point< C > & | v1, |
| const shape::point< C > & | v2 | ||
| ) | [inline] |
Definition at line 29 of file point_glue.hpp.
{return v1!=v2;}
| bool mmx::shape::exact_neq | ( | const shape::color< shape::MGXK > & | v1, |
| const shape::color< shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 26 of file color_glue.hpp.
{return v1!=v2;}
| bool mmx::shape::exact_neq | ( | const shape::algebraic_curve< rational, shape::MGXK > & | v1, |
| const shape::algebraic_curve< rational, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 32 of file algebraic_curve_glue.hpp.
{return v1!=v2;}
| bool mmx::shape::exact_neq | ( | const shape::point_set< C, shape::with_color< V > > & | v1, |
| const shape::point_set< C, shape::with_color< V > > & | v2 | ||
| ) | [inline] |
Definition at line 24 of file point_set_with_color_glue.hpp.
{return v1!=v2;}
| bool mmx::shape::exact_neq | ( | const shape::curve_rational< rational, shape::MGXK > & | v1, |
| const shape::curve_rational< rational, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 40 of file curve_rational_glue.hpp.
{return v1!=v2;}
| bool mmx::shape::exact_neq | ( | const shape::surface_algebraic< rational, shape::MGXK > & | v1, |
| const shape::surface_algebraic< rational, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 34 of file surface_algebraic_glue.hpp.
{return v1!=v2;}
| bool mmx::shape::exact_neq | ( | const shape::bounding_box< double, shape::MGXK > & | v1, |
| const shape::bounding_box< double, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 27 of file bounding_box_glue.hpp.
{return v1!=v2;}
| Seq<typename topology<C,V>::Point *> mmx::shape::extremal | ( | const algebraic_curve< C, V > & | c, |
| const bounding_box< C, V > & | b | ||
| ) |
Definition at line 32 of file algebraic_curve_fcts.hpp.
References solver_implicit< C, V >::extremal().
{
typedef typename topology<C,V>::Point Point;
Seq<Point*> res;
solver_implicit<C,V>::extremal(res,c.equation(),b);
return res;
}
| void mmx::shape::face_refine | ( | face< C, V, POINT > * | f0, |
| face< C, V, POINT > * | f1, | ||
| double | s, | ||
| int | v | ||
| ) |
Definition at line 235 of file face.hpp.
{
typedef typename SELF::Point Point;
Seq<Point*> l1;
for(unsigned j=0;j<3;j++)
if ( ((*f1->points(j))[v]==s) )
for(unsigned i=0;i<3;i++) {
if ( ((*f0->points(i))[v]==s) &&
(i+1<f0->size()) &&
((*f0->points(i+1))[v]==s) ) {
l1<<(f1->points(j));
}
if ( (i==(f0->size()-1)) &&
((*f0->points(i))[v]==s) &&
((*f0->points(0))[v]==s) ){
l1<<(f1->points(j));
}
}
// std::cout<<"Add "<<l1.size()<<" point(s) to face of size "<<f0->size()<<std::endl;
foreach(Point* p1,l1) f0->insert(p1);
}
| syntactic mmx::shape::flatten | ( | const shape::curve_rational< rational, shape::MGXK > & | s | ) | [inline] |
Definition at line 51 of file curve_rational_glue.hpp.
References flatten().
{
using namespace shape;
syntactic res = "RationalCurve";
return res;
if(s.dimension()>1)
return apply(res, mmx::flatten(s.numerator(0)), mmx::flatten(s.numerator(1)), mmx::flatten(s.denominator()));
else
return apply(res, mmx::flatten(s.numerator(0)), mmx::flatten(s.denominator()));
}
| syntactic mmx::shape::flatten | ( | const shape::bounding_box< double, shape::MGXK > & | s | ) | [inline] |
Definition at line 38 of file bounding_box_glue.hpp.
References flatten().
{
vector<syntactic> box;
box<<mmx::flatten(s.xmin());
box<<mmx::flatten(s.xmax());
box<<mmx::flatten(s.ymin());
box<<mmx::flatten(s.ymax());
box<<mmx::flatten(s.zmin());
box<<mmx::flatten(s.zmax());
return mmx::flatten(box);
}
| syntactic mmx::shape::flatten | ( | const shape::ImplicitCurve & | s | ) |
Definition at line 41 of file glue_implicit_curve.hpp.
References flatten().
{
using namespace shape;
syntactic res = "ImplicitCurve";
vector<syntactic> box;
box<<mmx::flatten(s.boundingBox()->xmin());
box<<mmx::flatten(s.boundingBox()->xmax());
box<<mmx::flatten(s.boundingBox()->ymin());
box<<mmx::flatten(s.boundingBox()->ymax());
return apply(res, mmx::flatten(s.equation()), mmx::flatten(box));
}
| syntactic mmx::shape::flatten | ( | const shape::viewer< shape::axel, shape::MGXK > & | axl | ) | [inline] |
Definition at line 34 of file axel_glue.hpp.
{
return apply(syntactic("Axel"), syntactic(axl.file));
}
| syntactic mmx::shape::flatten | ( | const shape::algebraic_curve< rational, shape::MGXK > & | s | ) | [inline] |
Definition at line 43 of file algebraic_curve_glue.hpp.
Referenced by flatten().
{
using namespace shape;
syntactic res = "AlgebraicCurve";
if(s.nbequation()>1)
return apply(res, mmx::flatten(s.equation(0)), mmx::flatten(s.equation(1)));
else
return apply(res, mmx::flatten(s.equation(0)));
}
| syntactic mmx::shape::flatten | ( | const shape::point< C > & | p | ) | [inline] |
Definition at line 40 of file point_glue.hpp.
References flatten().
{
vector<syntactic> v;
v<<mmx::flatten(p[0]);
v<<mmx::flatten(p[1]);
v<<mmx::flatten(p[2]);
return mmx::flatten(v);
}
| syntactic mmx::shape::flatten | ( | const shape::color< shape::MGXK > & | s | ) | [inline] |
Definition at line 37 of file color_glue.hpp.
References flatten().
{
syntactic res = "Color";
return apply(res,
mmx::flatten(s.r), mmx::flatten(s.g), mmx::flatten(s.b));
}
| syntactic mmx::shape::flatten | ( | const shape::point_set< C, shape::with_color< V > > & | axl | ) | [inline] |
Definition at line 35 of file point_set_with_color_glue.hpp.
{
return apply(syntactic("ColorPointSet"), syntactic("..."));
}
| syntactic mmx::shape::flatten | ( | const shape::surface_algebraic< rational, shape::MGXK > & | s | ) |
Definition at line 45 of file surface_algebraic_glue.hpp.
References flatten().
{
using namespace shape;
syntactic res = "AlgebraicSurface";
return apply(res, mmx::flatten(s.equation()));
}
| unsigned mmx::shape::hash | ( | const shape::algebraic_curve< rational, shape::MGXK > & | v | ) | [inline] |
Definition at line 34 of file algebraic_curve_glue.hpp.
Referenced by exact_hash(), and soft_hash().
{
register unsigned i, h= 214365, n=1;
for (i=0; i<n; i++) h= (h<<1) ^ (h<<5) ^ (h>>27) ;//^ hash(v[i]);
return h;
}
| unsigned mmx::shape::hash | ( | const shape::bounding_box< double, shape::MGXK > & | v | ) | [inline] |
Definition at line 29 of file bounding_box_glue.hpp.
{
register unsigned i, h= 214365, n=1;
for (i=0; i<n; i++) h= (h<<1) ^ (h<<5) ^ (h>>27) ;//^ hash(v[i]);
return h;
}
| unsigned mmx::shape::hash | ( | const shape::viewer< shape::axel, K > & | v | ) | [inline] |
Definition at line 24 of file axel_glue.hpp.
{
register unsigned i, h= 214365, n=1;
for (i=0; i<n; i++) h= (h<<1) ^ (h<<5) ^ (h>>27) ;//^ hash(v[i]);
return h;
}
| unsigned mmx::shape::hash | ( | const shape::ImplicitCurve & | v | ) | [inline] |
Definition at line 33 of file glue_implicit_curve.hpp.
{
register unsigned i, h= 214365, n=1;
for (i=0; i<n; i++) h= (h<<1) ^ (h<<5) ^ (h>>27) ;//^ hash(v[i]);
return h;
}
| unsigned mmx::shape::hash | ( | const shape::curve_rational< rational, shape::MGXK > & | v | ) | [inline] |
Definition at line 42 of file curve_rational_glue.hpp.
{
register unsigned i, h= 214365, n=1;
for (i=0; i<n; i++) h= (h<<1) ^ (h<<5) ^ (h>>27) ;//^ hash(v[i]);
return h;
}
| unsigned mmx::shape::hash | ( | const shape::point< C > & | v | ) | [inline] |
Definition at line 31 of file point_glue.hpp.
{
register unsigned i, h= 214365, n=1;
for (i=0; i<n; i++) h= (h<<1) ^ (h<<5) ^ (h>>27) ;//^ hash(v[i]);
return h;
}
| unsigned mmx::shape::hash | ( | const shape::color< shape::MGXK > & | v | ) | [inline] |
Definition at line 28 of file color_glue.hpp.
{
register unsigned i, h= 214365, n=1;
for (i=0; i<n; i++) h= (h<<1) ^ (h<<5) ^ (h>>27) ;//^ hash(v[i]);
return h;
}
| unsigned mmx::shape::hash | ( | const shape::point_set< C, shape::with_color< V > > & | v | ) | [inline] |
Definition at line 26 of file point_set_with_color_glue.hpp.
{
register unsigned i, h= 214365, n=1;
for (i=0; i<n; i++) h= (h<<1) ^ (h<<5) ^ (h>>27) ;//^ hash(v[i]);
return h;
}
| unsigned mmx::shape::hash | ( | const shape::surface_algebraic< rational, shape::MGXK > & | v | ) | [inline] |
Definition at line 36 of file surface_algebraic_glue.hpp.
{
register unsigned i, h= 214365, n=1;
for (i=0; i<n; i++) h= (h<<1) ^ (h<<5) ^ (h>>27) ;//^ hash(v[i]);
return h;
}
| int mmx::shape::indexof | ( | list< T > | l, |
| T | t | ||
| ) |
| void insert | ( | list< T > & | l, |
| int | p, | ||
| T | t | ||
| ) |
Definition at line 48 of file list.hpp.
Referenced by mmx::GLUE_140(), mmx::GLUE_158(), mmx::GLUE_17(), topology< C, V >::insert(), and mesher3d_curve_algebraic< C, V >::insert().
{
typename list<T>::iterator it = l.begin() ;
for(int i = 1 ; i < p ; i++, it++) ;
l.insert(it, t) ;
}
| void mmx::shape::insert_bbx | ( | T * | t, |
| bounding_box< C, V > * | bx | ||
| ) |
Definition at line 398 of file bounding_box.hpp.
References Edge.
{
typedef typename T::Point Point;
typedef typename T::Edge Edge;
Point
*p0= new Point(bx->xmin(),bx->ymin(),bx->zmin()),
*p1= new Point(bx->xmin(),bx->ymax(),bx->zmin()),
*p2= new Point(bx->xmax(),bx->ymax(),bx->zmin()),
*p3= new Point(bx->xmax(),bx->ymin(),bx->zmin());
t->insert(p0);t->insert(p1); t->insert(new Edge(p0,p1));
t->insert(p1);t->insert(p2); t->insert(new Edge(p1,p2));
t->insert(p2);t->insert(p3); t->insert(new Edge(p2,p3));
t->insert(p3);t->insert(p0); t->insert(new Edge(p3,p0));
Point
*q0= new Point(bx->xmin(),bx->ymin(),bx->zmax()),
*q1= new Point(bx->xmin(),bx->ymax(),bx->zmax()),
*q2= new Point(bx->xmax(),bx->ymax(),bx->zmax()),
*q3= new Point(bx->xmax(),bx->ymin(),bx->zmax());
t->insert(q0);t->insert(q1); t->insert(new Edge(q0,q1));
t->insert(q1);t->insert(q2); t->insert(new Edge(q1,q2));
t->insert(q2);t->insert(q3); t->insert(new Edge(q2,q3));
t->insert(q3);t->insert(q0); t->insert(new Edge(q3,q0));
t->insert(p0);t->insert(q0);t->insert(new Edge(p0,q0));
t->insert(p1);t->insert(q1);t->insert(new Edge(p1,q1));
t->insert(p2);t->insert(q2);t->insert(new Edge(p2,q2));
t->insert(p3);t->insert(q3);t->insert(new Edge(p3,q3));
}
| void mmx::shape::insert_bbx | ( | T * | t, |
| bounding_box< C, V > * | bx, | ||
| int | v, | ||
| int | s | ||
| ) |
Definition at line 430 of file bounding_box.hpp.
References Edge.
{
typedef typename T::Point Point;
typedef typename T::Edge Edge;
Point
*p0= new Point(bx->xmin(),bx->ymin(),bx->zmin()),
*p1= new Point(bx->xmin(),bx->ymax(),bx->zmin()),
*p2= new Point(bx->xmax(),bx->ymax(),bx->zmin()),
*p3= new Point(bx->xmax(),bx->ymin(),bx->zmin());
Point
*q0= new Point(bx->xmin(),bx->ymin(),bx->zmax()),
*q1= new Point(bx->xmin(),bx->ymax(),bx->zmax()),
*q2= new Point(bx->xmax(),bx->ymax(),bx->zmax()),
*q3= new Point(bx->xmax(),bx->ymin(),bx->zmax());
if(v==2) {
if(s==0) {
t->insert(p0);t->insert(p1); t->insert(new Edge(p0,p1));
t->insert(p1);t->insert(p2); t->insert(new Edge(p1,p2));
t->insert(p2);t->insert(p3); t->insert(new Edge(p2,p3));
t->insert(p3);t->insert(p0); t->insert(new Edge(p3,p0));
} else {
t->insert(q0);t->insert(q1); t->insert(new Edge(q0,q1));
t->insert(q1);t->insert(q2); t->insert(new Edge(q1,q2));
t->insert(q2);t->insert(q3); t->insert(new Edge(q2,q3));
t->insert(q3);t->insert(q0); t->insert(new Edge(q3,q0));
}
} else if(v==1) {
if(s==0) {
t->insert(p0);t->insert(q0);t->insert(new Edge(p0,q0));
t->insert(q0);t->insert(q3);t->insert(new Edge(q0,q3));
t->insert(q3);t->insert(p3);t->insert(new Edge(q3,p3));
t->insert(p3);t->insert(p0);t->insert(new Edge(p3,p0));
} else {
t->insert(p1);t->insert(q1);t->insert(new Edge(p1,q1));
t->insert(q1);t->insert(q2);t->insert(new Edge(q1,q2));
t->insert(q2);t->insert(p2);t->insert(new Edge(q2,p2));
t->insert(p2);t->insert(p1);t->insert(new Edge(p2,p1));
}
} else if (v==0) {
if(s==0) {
t->insert(p0);t->insert(q0);t->insert(new Edge(p0,q0));
t->insert(q0);t->insert(q1);t->insert(new Edge(q0,q1));
t->insert(q1);t->insert(p1);t->insert(new Edge(p1,q1));
t->insert(p1);t->insert(p0);t->insert(new Edge(p1,p0));
} else {
t->insert(p2);t->insert(q2);t->insert(new Edge(p2,q2));
t->insert(q2);t->insert(q3);t->insert(new Edge(q2,q3));
t->insert(q3);t->insert(p3);t->insert(new Edge(p3,q3));
t->insert(p3);t->insert(p2);t->insert(new Edge(p3,p2));
}
}
}
| shape::edge_set<K>* mmx::shape::intersection | ( | shape::surface_parametric< K > * | srfa, |
| shape::surface_parametric< K > * | srfb | ||
| ) |
Definition at line 17 of file ssi_surface_parametric.hpp.
References Edge, EdgeSet, and SSIQTSL::spcs.
Referenced by intersection2d_factory< C, V >::compute(), and mmx::solve_cf().
{
typedef typename EdgeSet::Point Point;
typedef typename EdgeSet::Edge Edge;
typedef typename EdgeSet::PointIterator PointIterator;
SSIQTSL ssi( srfa, srfb, 100 );
int nbv =ssi.spcs.size();
EdgeSet * result = new EdgeSet(nbv);
// IntersectionResult * result = new IntersectionResult(IGLGood::E_LINE,ssi.spcs.size(),ssi.spcs.size());
//std::copy(ssi.spcs.begin(),ssi.spcs.end(),(fxv<double,3>*)(result->glg->vertices));
PointIterator p=result->begin();
for ( int i = 0; i < nbv; i ++, p++ ) {
p->setx(ssi.spcs[i][0]);
p->sety(ssi.spcs[i][1]);
p->setz(ssi.spcs[i][2]);
}
Point * p1, * p2;
for ( int i = 0; i < nbv; i+=2) {
p1= &result->vertex(i);
p2= &result->vertex(i+1);
result->push_edge(new Edge(p1,p2));
}
// result->glg->indexes[i] = i;
return result;
};
| bool mmx::shape::is_adjacentpl3d | ( | CELL * | c1, |
| CELL * | c2 | ||
| ) |
Definition at line 581 of file cell3d.hpp.
Referenced by dualize< C, V, Shape, Cell >::get_dual_edge(), and dualize< C, V, Shape, Cell >::get_dual_face().
{
if(c1->xmax()<c2->xmin() || c2->xmax()<c1->xmin())
return false;
if(c1->ymax()<c2->ymin() || c2->ymax()<c1->ymin())
return false;
if(c1->zmax()<c2->zmin() || c2->zmax()<c1->zmin())
return false;
if((c1->xmax()==c2->xmin() || c2->xmax()==c1->xmin())) {
if((c1->ymax()==c2->ymin() || c2->ymax()==c1->ymin()) ||
(c1->zmax()==c2->zmin() || c2->zmax()==c1->zmin()) )
return false;
} else if((c1->ymax()==c2->ymin() || c2->ymax()==c1->ymin()) &&
(c1->zmax()==c2->zmin() || c2->zmax()==c1->zmin()) )
return false;
return true;
}
| bool mmx::shape::is_adjacentpl3d | ( | CELL * | c1, |
| CELL * | c2, | ||
| CELL * | c3 | ||
| ) |
Definition at line 606 of file cell3d.hpp.
References xMAX, xMIN, yMAX, yMIN, zMAX, and zMIN.
{
if(c1->xmax()< xMIN || xMAX <c1->xmin())
return false;
if(c1->ymax()<yMIN || yMAX<c1->ymin())
return false;
if(c1->zmax()<zMIN || zMAX<c1->zmin())
return false;
if((c1->xmax()==xMIN || xMAX==c1->xmin())) {
if((c1->ymax()==yMIN || yMAX==c1->ymin()) ||
(c1->zmax()==zMIN || zMAX==c1->zmin()) )
return false;
} else if((c1->ymax()==yMIN || yMAX==c1->ymin()) &&
(c1->zmax()==zMIN || zMAX==c1->zmin()) )
return false;
return true;
}
| double mmx::shape::lower | ( | const bounding_box< C, V > & | bx, |
| int | v | ||
| ) | [inline] |
Definition at line 113 of file bounding_box.hpp.
Referenced by solver_implicit< C, V >::common_edge_point(), mmx::create_curve_rational(), solver_implicit< C, V >::edge_point(), plot(), and point_on_edge().
{
switch(v) {
case 0:
return bx.xmin(); break ;
case 1:
return bx.ymin(); break ;
default:
return bx.zmin(); break ;
}
}
| double mmx::shape::lower | ( | double | x | ) | [inline] |
Definition at line 32 of file solver_implicit.hpp.
{return x;}
| curve_pl<C, REF_OF(V) >* mmx::shape::mesh | ( | parametric_curve< C, V > * | pc | ) |
Definition at line 93 of file parametric_curve.hpp.
{
typedef typename PLCurve::Edge Edge;
int n = 500;
PLCurve* res = new PLCurve;//n,n-1,0,0,false);
pc->sample(res->begin(), n);
for ( int i = 0; i < n-1; i ++ ) {
res->push_edge(new Edge(&res->vertex(i),&res->vertex(i+1)));
}
return res;
}
| double mmx::shape::mmxmax | ( | double | a, |
| double | b | ||
| ) | [inline] |
Definition at line 142 of file bounding_box.hpp.
Referenced by bounding_box< C, V >::intersect(), bounding_box< C, V >::intersected(), bounding_box< C, V >::intersects(), bounding_box< C, V >::unite(), bounding_box< C, V >::united(), and bounding_box< C, V >::unites().
{
return (a >= b) ? a : b ;
}
| double mmx::shape::mmxmin | ( | double | a, |
| double | b | ||
| ) | [inline] |
Definition at line 137 of file bounding_box.hpp.
Referenced by bounding_box< C, V >::intersect(), bounding_box< C, V >::intersected(), bounding_box< C, V >::intersects(), bounding_box< C, V >::unite(), bounding_box< C, V >::united(), and bounding_box< C, V >::unites().
{
return (a <= b) ? a : b ;
}
| bool mmx::shape::neq | ( | const shape::ImplicitCurve & | v1, |
| const shape::ImplicitCurve & | v2 | ||
| ) | [inline] |
Definition at line 31 of file glue_implicit_curve.hpp.
{return v1!=v2;}
| bool mmx::shape::operator!= | ( | const shape::algebraic_curve< rational, shape::MGXK > & | v1, |
| const shape::algebraic_curve< rational, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 30 of file algebraic_curve_glue.hpp.
{return !(v1==v2);}
| bool mmx::shape::operator!= | ( | const shape::ImplicitCurve & | v1, |
| const shape::ImplicitCurve & | v2 | ||
| ) | [inline] |
Definition at line 29 of file glue_implicit_curve.hpp.
{return !(v1==v2);}
| bool mmx::shape::operator!= | ( | const shape::point< C > & | v1, |
| const shape::point< C > & | v2 | ||
| ) | [inline] |
Definition at line 27 of file point_glue.hpp.
{return !(v1==v2);}
| bool mmx::shape::operator!= | ( | const shape::color< shape::MGXK > & | v1, |
| const shape::color< shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 24 of file color_glue.hpp.
{return !(v1==v2);}
| bool mmx::shape::operator!= | ( | const shape::point_set< C, shape::with_color< V > > & | v1, |
| const shape::point_set< C, shape::with_color< V > > & | v2 | ||
| ) | [inline] |
Definition at line 21 of file point_set_with_color_glue.hpp.
{return !(v1==v2);}
| bool mmx::shape::operator!= | ( | const shape::viewer< shape::axel, K > & | v1, |
| const shape::viewer< shape::axel, K > & | v2 | ||
| ) | [inline] |
Definition at line 19 of file axel_glue.hpp.
{return !(v1==v2);}
| bool mmx::shape::operator!= | ( | const shape::bounding_box< double, shape::MGXK > & | v1, |
| const shape::bounding_box< double, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 25 of file bounding_box_glue.hpp.
{return !(v1==v2);}
| bool mmx::shape::operator!= | ( | const shape::curve_rational< rational, shape::MGXK > & | v1, |
| const shape::curve_rational< rational, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 38 of file curve_rational_glue.hpp.
{return !(v1==v2);}
| bool mmx::shape::operator!= | ( | const shape::surface_algebraic< rational, shape::MGXK > & | v1, |
| const shape::surface_algebraic< rational, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 32 of file surface_algebraic_glue.hpp.
{return !(v1==v2);}
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | os, |
| int | s | ||
| ) | [inline] |
Definition at line 159 of file viewer_axel.hpp.
References viewer< axel, V >::vw.
{
os.vw<<s;return os;
}
| AXEL& mmx::shape::operator<< | ( | AXEL & | out, |
| const surface_rational< K, N > & | c | ||
| ) |
Definition at line 112 of file surface_rational.hpp.
References print().
{
out<<"\n <surface type=\"rational\">\n";
out<<" <domain>"<< c.umin()<<" "<<c.umax()<<" "<<c.vmin()<<" "<<c.vmax()<<"</domain>\n";
for(int i=0; i<N;i++){
out<<" <polynomial>";
print(out,c.numerator(i),variables("t"));
out<<"</polynomial>\n";
}
out<<" <polynomial>";
print(out,c.denominator(),variables("t"));
out<<"</polynomial>\n";
out<<" </surface>\n";
return out;
}
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | out, |
| const tpl3d< C, V > & | tp | ||
| ) |
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | out, |
| const edge_set< C, V > & | s | ||
| ) |
Definition at line 147 of file edge_set.hpp.
References Edge.
{
typedef typename SELF::Edge Edge;
out<<" <curve type=\"mesh\">\n<vect>\nVECT\n";
out<<s.nbe()<<" "
<<2*s.nbe()<<" "
<<s.nbe()<<"\n";
for(unsigned i=0; i<s.nbe();i++) out<<"2 ";
out<<"\n";
for(unsigned i=0; i<2*s.nbe();i++) out<<"1 ";
out<<"\n";
foreach(Edge* e, s.edges()) {
out <<e->source()->x()<<" "
<<e->source()->y()<<" "
<<e->source()->z()<<" "
<<e->destination()->x()<<" "
<<e->destination()->y()<<" "
<<e->destination()->z()<<"\n";
}
for(unsigned i=0; i<s.nbe();i++)
out<< "0.98 0.05 0.05 1\n";
out<<" </vect>\n </curve>\n";
return out;
}
| viewer<axel,I>& mmx::shape::operator<< | ( | viewer< axel, I > & | out, |
| face< C, V, POINT > * | p | ||
| ) |
Definition at line 210 of file face.hpp.
References viewer< axel, V >::color.
{
using namespace shape;
out<<"<domain type=\"mesh\" name=\"face_"
<< p->get_index()<<"\"color=\""
<< out.color.r <<" "
<< out.color.g <<" "
<< out.color.r <<"\">\n";
out<<"<off>\n";
out<<p->size()<<" "<<1<<" "<<0<<"\n";
//foreach(Point* pt, *p)
for (unsigned i=0;i<p->size();i++)
{
out<<(*p)[i]->x()<<" "<<(*p)[i]->y()<<" "<<(*p)[i]->z()<<"\n";
}
out<<p->size();
for (unsigned i=0;i<p->size();i++)
out<<" "<<i;
out<<"\n</off>\n";
out<<"</domain>\n";
return out;
}
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | os, |
| const char * | s | ||
| ) | [inline] |
Definition at line 144 of file viewer_axel.hpp.
References viewer< axel, V >::vw.
{
os.vw<<s; return os;
}
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | os, |
| const std::string & | s | ||
| ) | [inline] |
Definition at line 149 of file viewer_axel.hpp.
References viewer< axel, V >::vw.
{
os.vw<<s; return os;
}
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | os, |
| double | s | ||
| ) | [inline] |
Definition at line 164 of file viewer_axel.hpp.
References viewer< axel, V >::vw.
{
os.vw<<s;return os;
}
| std::ostream& mmx::shape::operator<< | ( | std::ostream & | os, |
| const color< K > & | c | ||
| ) | [inline] |
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | os, |
| const bounding_box< double, V > & | bx | ||
| ) |
Definition at line 170 of file viewer_axel.hpp.
{
for(unsigned i=0;i<3;i++)
for(unsigned j=0;j<2;j++)
os(i,j)=bx(i,j);
return os;
}
| viewer<V>& mmx::shape::operator<< | ( | viewer< V > & | out, |
| const voronoi2d< C, V > & | tp | ||
| ) |
Definition at line 686 of file voronoi2d.hpp.
References VoronoiSite2d.
{
foreach(Shape* vs, tp.m_objects)
{
out<<" <point color=\"255 127 0\"> "<<
((VoronoiSite2d *)vs)->x() << " "<<
((VoronoiSite2d *)vs)->y() << " "<<
((VoronoiSite2d *)vs)->z() << "</point>\n";
}
return out;
}
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | out, |
| const topology2d< C, V > & | tp | ||
| ) |
Definition at line 422 of file topology2d.hpp.
{
typedef SELF Topology2d;
typedef typename Topology2d::Point Point;
typedef typename Topology2d::Edge Edge;
//shape::edge<K> Edge;
//
foreach(Point* p, tp.m_specials) out<<(*p)<<"\n";
out<<" <curve type=\"mesh\">\n<vect>\nVECT\n";
out<<tp.nbe()<<" "
<<2*tp.nbe()<<" "
<<tp.nbe()<<"\n";
for(int i=0; i<tp.nbe();i++) out<<"2 ";
out<<"\n";
for(int i=0; i<tp.nbe();i++) out<<"1 ";
out<<"\n";
foreach(Edge* e, tp.edges()) {
out <<e->source()->x()<<" "<<e->source()->y()<<" 0 "
<<e->destination()->x()<<" "<<e->destination()->y()<<" 0 "
<<"\n";
}
for(int i=0; i<tp.nbe();i++)
out<< "0.314 0.979 1 1\n";
out<<" </vect>\n </curve>\n";
return out;
}
| viewer<V>& mmx::shape::operator<< | ( | viewer< V > & | out, |
| const mesher3d_shape< C, V > & | tp | ||
| ) |
Definition at line 166 of file mesher3d_shape.hpp.
{
use<tpl3d_def,V>::print_as_graphic(out,tp);
return out;
}
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | out, |
| const curve_pl< C, V > * | s | ||
| ) |
Definition at line 125 of file curve_pl.hpp.
References Edge.
{
typedef typename SELF::Edge Edge;
out<<" <curve type=\"mesh\">\n<vect>\nVECT\n";
out<<s->nbe()<<" "
<<s->nbv()<<" "
<<s->nbe()<<"\n";
for(unsigned i=0; i<s->nbe();i++) out<<"2 ";
out<<"\n";
for(unsigned i=0; i<s->nbv();i++) out<<"1 ";
out<<"\n";
foreach(Edge* e, s->edges()) {
out <<e->source()->x()<<" "
<<e->source()->y()<<" "
<<e->source()->z()<<" "
<<e->destination()->x()<<" "
<<e->destination()->y()<<" "
<<e->destination()->z()<<"\n";
}
for(unsigned i=0; i<s->nbe();i++)
out<< "0.314 0.979 1 1\n";
out<<" </vect>\n </curve>\n";
return out;
}
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | os, |
| const typename viewer< axel, V >::Color & | c | ||
| ) | [inline] |
Definition at line 178 of file viewer_axel.hpp.
References viewer< axel, V >::color.
{
os.color.r=c.r;
os.color.g=c.g;
os.color.b=c.b;
return os;
}
| std::ostream& mmx::shape::operator<< | ( | std::ostream & | os, |
| const Width & | c | ||
| ) | [inline] |
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | os, |
| const graphic< C, W > & | s | ||
| ) |
Definition at line 186 of file viewer_axel.hpp.
References point().
{
if (s.type == 0) {
os <<"<pointset size=\""<<s.nbv<<"\" color=\"rgb\">\n";
for(unsigned i =0;i<s.nbv;i++)
os<<s.vertices[3*i]<<" "<<s.vertices[3*i+1]<<" "<<s.vertices[3*i+2]
<<" 255 75 75\n";
os <<"</pointset>\n";
} else if (s.type == 1) {
typedef fxv<double,3> point;
point * P = (point*)(s.vertices);
int * Vs = (s.indices);
os <<"<curve type=\"mesh\">\n<vect>\n";
os <<"VECT\n";
os <<s.nbi/2 << " " << s.nbi <<" "<<s.nbi/2<<"\n";
for(unsigned i =0;i<s.nbi/2;i++)
os<<"2 "; os<<"\n";
for(unsigned i =0;i<s.nbi/2;i++)
os<<"1 "; os<<"\n";
for(unsigned i=0;i<s.nbi/2 ;i++) {
os << P[Vs[2*i]][0] <<" "<< P[Vs[2*i]][1] <<" "<< P[Vs[2*i]][2] <<" ";
os << P[Vs[2*i+1]][0] <<" "<< P[Vs[2*i+1]][1] <<" "<< P[Vs[2*i+1]][2];
os << "\n";
}
for(unsigned i =0;i<s.nbi/2;i++)
os<<os.color.r<<" "<<os.color.g<<" "<<os.color.b<<" "<<"1\n";
os <<"</vect>\n</curve>\n";
} else if (s.type == 2) {
std::cout<<"Surface"<<std::endl;
typedef fxv<double,3> point;
int * Vs = (s.indices);
os <<"<surface type=\"mesh\">\n<off>\n";
os <<s.nbv<<" "<<s.nbi/3<<" 0\n";
for(unsigned i=0;i<s.nbv;i++)
os<<s.vertices[3*i]<<" "<<s.vertices[3*i+1]<<" "<<s.vertices[3*i+2] <<"\n";
for(unsigned i=0;i<s.nbi/3;i++)
os <<"3 "<< Vs[3*i] <<" "<< Vs[3*i+1] <<" "<< Vs[3*i+2] <<"\n";
os <<"</off>\n</surface>\n";
}
return os;
}
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | os, |
| const surface_algebraic< C, V > & | s | ||
| ) |
Definition at line 78 of file surface_algebraic.hpp.
{
os<<"<surface type=\"implicit\" color=\""
<<int(os.color.r*255)<<" "
<<int(os.color.g*255)<<" "
<<int(os.color.b*255)<<"\">\n";
os<<" <domain>"
<<os(0,0)<<" "<<os(0,1)<<" "
<<os(1,0)<<" "<<os(1,1)<<" "
<<os(2,0)<<" "<<os(2,1)
<<"</domain>\n";
os<<" <polynomial>";
print_as_double(os,s.equation().rep(),variables("x y z"));
os<<"</polynomial>\n";
os<<"</surface>\n";
return os;
}
| std::ostream& mmx::shape::operator<< | ( | std::ostream & | stream, |
| const bounding_box< C, V > & | c | ||
| ) |
Definition at line 368 of file bounding_box.hpp.
References bounding_box< C, V >::xmin().
{
if(c.is0D())
return stream << "[]" ;
else if(c.is1D())
return stream << "[" << c.xmin() << ", " << c.xmax() << "]" ;
else if(c.is2D())
return stream << "[" << c.xmin() << ", " << c.xmax() << "] x [" << c.ymin() << ", " << c.ymax() << "]" ;
else if(c.is3d())
return stream << "[" << c.xmin() << ", " << c.xmax() << "] x [" << c.ymin() << ", " << c.ymax() << "] x [" << c.zmin() << ", " << c.zmax() << "]" ;
else
return stream << "???" ;
}
| std::ostream& mmx::shape::operator<< | ( | std::ostream & | os, |
| const point< C, V, N > & | p | ||
| ) |
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | os, |
| const algebraic_curve< C, V > & | c | ||
| ) |
Definition at line 101 of file algebraic_curve.hpp.
References AlgebraicCurve, Polynomial, print(), and SELF.
{
typedef SELF AlgebraicCurve;
typedef typename AlgebraicCurve::Polynomial Polynomial;
os<<"<curve type=\"implicit\" color=\""<<(int)(255*os.color.r)<<" "<<(int)(255*os.color.g)<<" "<<(int)(255*os.color.b)<<"\">\n";
os<<" <domain>"
<<os(0,0)<<" "<<os(0,1)<<" "
<<os(1,0)<<" "<<os(1,1)<<" "
<<os(2,0)<<" "<<os(2,1)
<<"</domain>\n";
for(unsigned i=0; i<c.equations().size();i++)
{
typename use<numeric_def,V>::Integer m=1;
Polynomial p=c.equation(i);
for(typename Polynomial::const_iterator it=p.begin();it!=p.end();it++){
m = lcm(denominator(it->coeff()), m);
}
p*=(typename Polynomial::Scalar)m;
os<<(char*)" <polynomial>";
print(os,p,variables("x y z"));
os<<(char*)"</polynomial>\n";
}
os<<"</curve>\n";
return os;
}
| viewer<axel, K>& mmx::shape::operator<< | ( | viewer< axel, K > & | out, |
| const Graph< T > & | g | ||
| ) |
Definition at line 765 of file graph.hpp.
{
//Seq<T> vertices;
if (g.nbe()==0) return out;
Seq<T> edges;
g.edge_list(edges);
out<<" <curve type=\"mesh\">\n<vect>\nVECT\n";
out<<g.nbe()<<" "
//<<g.nbv()<<" "
<<2*g.nbe()<<" "
<<g.nbe()<<"\n";
for(unsigned i=0; i<g.nbe();i+=2) out<<"2 ";//
out<<"\n";
// for(unsigned i=0; i<g.nbv();i++) out<<"1 ";
// out<<"\n";
for(unsigned i=0; i<g.nbe();i+=2) out<<"1 ";//
out<<"\n";
//g.dfs( vertices );
//print edges
// unsigned i;
// for (i=1;i<vertices.size(); i++)
// {
// out <<vertices[i-1]->x()<<" "<<vertices[i-1]->y() <<" 0 "
// <<vertices[i]->x() <<" "<<vertices[i]->y()<<" 0 "
// <<"\n";
// }
// out <<vertices[i-1]->x()<<" "<<vertices[i-1]->y() <<" 0 "
// <<vertices[0]->x() <<" "<<vertices[0]->y()<<" 0 "
// <<"\n";
//print edges
for (unsigned i=0;i<edges.size(); i+=2)
{
out <<edges[i]->x() <<" "<<edges[i]->y() <<" 0 "
<<edges[i+1]->x()<<" "<<edges[i+1]->y()<<" 0 "
<<"\n";
}
for(unsigned i=0; i<g.nbe();i++)
out<< "0.314 0.979 1 1\n";
out<<" </vect>\n </curve>\n";
return out;
}
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | os, |
| char | s | ||
| ) | [inline] |
Definition at line 139 of file viewer_axel.hpp.
References viewer< axel, V >::vw.
{
os.vw.put(s); return os;
}
| viewer<axel,W>& mmx::shape::operator<< | ( | viewer< axel, W > & | out, |
| const point_set< C, V > & | ps | ||
| ) |
Definition at line 104 of file point_set.hpp.
{
using namespace shape;
typedef typename SELF::Point Point;
typedef typename SELF::PointConstIterator PointIterator;
if(ps.nbv()>0) {
out<<"<pointset size=\""<<ps.nbv()<<"\" color=\"rgb\">\n";
for(PointIterator p= ps.begin(); p != ps.end(); p++) {
use<point_def,V>::print_with_color(out, *p);
out <<"\n";
}
out<<" </pointset>\n ";
}
return out;
}
| viewer<axel,W>& mmx::shape::operator<< | ( | viewer< axel, W > & | os, |
| const point< C, V, N > & | p | ||
| ) |
| shape::point_set<C,shape::with_color<V> >& mmx::shape::operator<< | ( | shape::point_set< C, shape::with_color< V > > & | s, |
| const vector< generic > & | v | ||
| ) | [inline] |
Definition at line 41 of file point_set_with_color_glue.hpp.
{
typedef typename SELF::Point Point;
typedef mmx::shape::color<V> Color;
shape::point<floating<>, shape::MGXK> P= as< shape::point<floating<>, shape::MGXK> >(v[0]);
Point p(as<double>(P[0]),as<double>(P[1]),as<double>(P[2]),as<Color>(v[1])) ;
s.push(p);
return s;
}
| curve_pl<C,V>& mmx::shape::operator<< | ( | curve_pl< C, V > & | c, |
| const typename curve_pl< C, V >::Edge & | e | ||
| ) |
Definition at line 118 of file curve_pl.hpp.
{
c.m_edges<< e;
return c;
}
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | os, |
| unsigned | s | ||
| ) | [inline] |
Definition at line 154 of file viewer_axel.hpp.
References viewer< axel, V >::vw.
{
os.vw<<s;return os;
}
| viewer<axel,V>& mmx::shape::operator<< | ( | viewer< axel, V > & | os, |
| const curve_rational< C, V > & | c | ||
| ) |
Definition at line 162 of file curve_rational.hpp.
References print().
{
os<<"\n <curve type=\"rational\" color=\""<<(int)(255*os.color.r)<<" "<<(int)(255*os.color.g)<<" "<<(int)(255*os.color.b)<<"\">\n";
os<<" <domain>"<< c.tmin()<<" "<<c.tmax()<<"</domain>\n";
for(int i=0; i<c.dimension();i++){
os<<" <polynomial>";
print(os,c.numerator(i),variables("t"));
os<<"</polynomial>\n";
}
os<<" <polynomial>";
print(os,c.denominator(),variables("t"));
os<<"</polynomial>\n";
os<<" </curve>\n";
return os;
}
| std::ostream& mmx::shape::operator<< | ( | std::ostream & | os, |
| const viewer< axel, V > & | g | ||
| ) | [inline] |
Definition at line 134 of file viewer_axel.hpp.
References viewer< axel, V >::file.
{
os <<"Axel("<<g.file<<")"; return os;
}
| bool mmx::shape::operator== | ( | const shape::surface_algebraic< rational, shape::MGXK > & | v1, |
| const shape::surface_algebraic< rational, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 31 of file surface_algebraic_glue.hpp.
{return v1.equation()==v2.equation();}
| bool mmx::shape::operator== | ( | const shape::algebraic_curve< rational, shape::MGXK > & | v1, |
| const shape::algebraic_curve< rational, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 29 of file algebraic_curve_glue.hpp.
{return true;}
| bool mmx::shape::operator== | ( | const shape::point_set< C, shape::with_color< V > > & | v1, |
| const shape::point_set< C, shape::with_color< V > > & | v2 | ||
| ) | [inline] |
Definition at line 20 of file point_set_with_color_glue.hpp.
{return true;}
| bool mmx::shape::operator== | ( | const shape::ImplicitCurve & | v1, |
| const shape::ImplicitCurve & | v2 | ||
| ) | [inline] |
Definition at line 28 of file glue_implicit_curve.hpp.
{return true;}
| bool mmx::shape::operator== | ( | const shape::curve_rational< rational, shape::MGXK > & | v1, |
| const shape::curve_rational< rational, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 37 of file curve_rational_glue.hpp.
{return true;}
| bool mmx::shape::operator== | ( | const shape::point< C > & | v1, |
| const shape::point< C > & | v2 | ||
| ) | [inline] |
Definition at line 26 of file point_glue.hpp.
{return true;}
| bool mmx::shape::operator== | ( | const shape::color< shape::MGXK > & | v1, |
| const shape::color< shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 23 of file color_glue.hpp.
{return true;}
| bool mmx::shape::operator== | ( | const shape::viewer< shape::axel, K > & | v1, |
| const shape::viewer< shape::axel, K > & | v2 | ||
| ) | [inline] |
Definition at line 18 of file axel_glue.hpp.
{return true;}
| bool mmx::shape::operator== | ( | const shape::bounding_box< double, shape::MGXK > & | v1, |
| const shape::bounding_box< double, shape::MGXK > & | v2 | ||
| ) | [inline] |
Definition at line 24 of file bounding_box_glue.hpp.
{return true;}
| point_set<C,V> mmx::shape::plot | ( | const algebraic_curve< C, V > & | c, |
| const bounding_box< C, V > & | bx, | ||
| int | N = 500 |
||
| ) |
Definition at line 40 of file algebraic_curve_fcts.hpp.
References lower(), PointSet, Polynomial, mmx::solve(), Solver, and upper().
{
typedef double Scalar;
typedef typename PointSet::Point Point;
typedef typename SELF::Polynomial Polynomial;
typedef typename Polynomial::Scalar Rational;
typedef solver<Rational, ContFrac<Approximate> > Solver;
Point pt(0,0,0);
PointSet pts;
Rational a0(bx.xmin()), a1(bx.xmax()), b0(bx.ymin()), b1(bx.ymax());
Rational dx= (a1-a0)/N;
Seq<Polynomial> sy = coefficients(c.equation(),1);
int d = sy.size()-1;
polynomial<Rational, with<MonomialTensor> > P(0,d);
for (int i=0; i<N;i++,a0+=dx) {
pt[0] = as<Scalar>(a0);
for (int u=0;u<=d;u++) P[u] = sy[u](a0);
typename Solver::Solutions sol; Solver::solve(sol,P,b0,b1);
for(unsigned u=0;u<sol.size();u++) {
pt[1] = as<Scalar>((lower(sol[u])+upper(sol[u]))/2);
pts<<pt;
}
}
Rational dy= (b1-b0)/N;
a0= Rational(bx.xmin());
Seq<Polynomial> sx = coefficients(c.equation(),0);
d = sx.size()-1;
polynomial<Rational, with<MonomialTensor> > Q(0,d);
for (int i=0; i<N;i++,b0+=dy) {
pt[1] = as<Scalar>(b0);
for (int u=0;u<=d;u++) Q[u] = sx[u]((Rational)0,b0);
typename Solver::Solutions sol; Solver::solve(sol,Q,a0,a1);
for(unsigned u=0;u<sol.size();u++) {
pt[0] = as<Scalar>((lower(sol[u])+upper(sol[u]))/2);
pts<<pt;
}
}
return pts;
}
| point<double>* mmx::shape::point_on_edge | ( | const bounding_box< double > & | bx, |
| double | u, | ||
| const S1 & | s1, | ||
| const S2 & | s2 | ||
| ) |
Definition at line 36 of file solver_implicit.hpp.
References mmx::eval(), lower(), and upper().
| void mmx::shape::print | ( | cell2d_voronoi_site2d< C, V > * | cv | ) | [inline] |
Definition at line 162 of file cell2d_voronoi_site2d.hpp.
{
typedef typename SELF::Point Point;
std::cout << "point(s) b: ";
foreach(Point* p, cv->n_intersections)
std::cout <<" ["<<p->x()<<" "<<p->y()<<"]";
foreach(Point* p, cv->s_intersections)
std::cout <<" ["<<p->x()<<" "<<p->y()<<"]";
foreach(Point* p, cv->w_intersections)
std::cout <<" ["<<p->x()<<" "<<p->y()<<"]";
foreach(Point* p, cv->e_intersections)
std::cout <<" ["<<p->x()<<" "<<p->y()<<"]";
std::cout<<std::endl;
std::cout << "Point(s) s: ";
foreach(Point* p, cv->m_singular)
std::cout <<" ["<<p->x()<<" "<<p->y()<<"]";
std::cout<<std::endl;
}
| void mmx::shape::print | ( | cell2d_algebraic_curve< C, V > * | cv | ) | [inline] |
Definition at line 216 of file cell2d_algebraic_curve.hpp.
Referenced by cell2d_voronoi_diagram< C, V >::insert_regular(), operator<<(), and mmx::operator<<().
{
typedef typename SELF::Point Point;
std::cout << "point(s) b: ";
foreach(Point* p, cv->n_intersections)
std::cout <<" ["<<p->x()<<" "<<p->y()<<"]";
foreach(Point* p, cv->s_intersections)
std::cout <<" ["<<p->x()<<" "<<p->y()<<"]";
foreach(Point* p, cv->w_intersections)
std::cout <<" ["<<p->x()<<" "<<p->y()<<"]";
foreach(Point* p, cv->e_intersections)
std::cout <<" ["<<p->x()<<" "<<p->y()<<"]";
std::cout<<std::endl;
std::cout << "Point(s) s: ";
foreach(Point* p, cv->m_singular)
std::cout <<" ["<<p->x()<<" "<<p->y()<<"]";
std::cout<<std::endl;
}
| viewer<axel,K>& mmx::shape::print_boxes | ( | viewer< axel, K > & | out, |
| Graph< T > | g | ||
| ) |
Definition at line 35 of file semialgebraic_domain2d_axel.hpp.
References CHECK, and Graph< T >::dfs().
{
//Seq<T> vertices;
double xmin,xmax,ymin,ymax;
Seq<T> v;
g.dfs(v);
//g.dfs(& shape::write_ok);
//g.vertex_list(v);
unsigned n=0;
for (unsigned i=0; i<v.size(); i++)
{
CHECK;
n+=4;
}
out<<" <curve type=\"mesh\" color=\"255 255 0\" >\n<vect>\nVECT\n";
out<<n <<" "
<<2*n <<" "
<<n <<"\n";
for(unsigned i=0; i<n; i++) out<<"2 ";//
out<<"\n";
for(unsigned i=0; i<n; i++) out<<"1 ";//
out<<"\n";
//print edges
for (unsigned i=0; i<v.size(); i++)
{
CHECK;
xmin= v[i]->boundingBox().xmin();
xmax= v[i]->boundingBox().xmax();
ymin= v[i]->boundingBox().ymin();
ymax= v[i]->boundingBox().ymax();
//std::cout <<xmin <<" "<<xmax <<" "<<ymin <<" "<<ymax <<"\n";
out <<xmin <<" "<<ymin <<" 0 "
<<xmax <<" "<<ymin <<" 0 "
<<"\n";
out <<xmax <<" "<<ymin <<" 0 "
<<xmax <<" "<<ymax <<" 0 "
<<"\n";
out <<xmax <<" "<<ymax <<" 0 "
<<xmin <<" "<<ymax <<" 0 "
<<"\n";
out <<xmin <<" "<<ymax <<" 0 "
<<xmin <<" "<<ymin <<" 0 "
<<"\n";
}
for(unsigned i=0; i<n; i++)
out<< "0.314 0.979 1 1\n";
out<<" </vect>\n </curve>\n";
return out;
}
| void mmx::shape::print_intersections | ( | cell2d< C, V > * | a | ) | [inline] |
Definition at line 469 of file cell2d.hpp.
{
typedef typename topology<C,V>::Point Point;
std::cout<< "Cell : " << a <<std::endl;
std::cout<< "EAST, " <<a->e_intersections.size() << std::endl;
foreach(Point* cl,a->e_intersections)
std::cout<< cl->x()<<" "<<cl->y() << std::endl;
std::cout<< "WEST, " <<a->w_intersections.size() << std::endl;
foreach(Point* cl,a->w_intersections)
std::cout<< cl->x()<<" "<<cl->y() << std::endl;
std::cout<< "NORTH, " <<a->n_intersections.size() << std::endl;
foreach(Point* cl,a->n_intersections)
std::cout<< cl->x()<<" "<<cl->y() << std::endl;
std::cout<< "SOUTH, " <<a->s_intersections.size() <<std::endl;
foreach(Point* cl,a->s_intersections)
std::cout<< cl->x()<<" "<<cl->y() << std::endl;
}
| void mmx::shape::print_neighbors | ( | cell2d< C, V > * | a | ) | [inline] |
Definition at line 451 of file cell2d.hpp.
References SELF.
{
std::cout<< "Cell : " << a <<std::endl;
std::cout<< "EAST, " <<a->e_neighbors.size() << std::endl;
foreach(SELF* cl,a->e_neighbors)
std::cout<< cl << std::endl;
std::cout<< "WEST, " <<a->w_neighbors.size() << std::endl;
foreach(SELF* cl,a->w_neighbors)
std::cout<< cl << std::endl;
std::cout<< "NORTH, " <<a->n_neighbors.size() << std::endl;
foreach(SELF* cl,a->n_neighbors)
std::cout<< cl << std::endl;
std::cout<< "SOUTH, " <<a->s_neighbors.size() <<std::endl;
foreach(SELF* cl,a->s_neighbors)
std::cout<< cl << std::endl;
}
| point<C,with_idx<V>,N>::Scalar mmx::shape::read | ( | const point< C, with_idx< V >, N > & | v, |
| unsigned | i | ||
| ) | [inline] |
Definition at line 126 of file point_with_idx.hpp.
{ return v[i]; }
| point<C,with_color<V>,N>::Scalar mmx::shape::read | ( | const point< C, with_color< V >, N > & | v, |
| unsigned | i | ||
| ) | [inline] |
Definition at line 110 of file point_with_color.hpp.
{ return v[i]; }
Definition at line 136 of file vertex.hpp.
{ return v[i]; }
| void remove | ( | list< T > & | l, |
| int | p | ||
| ) |
| void remove | ( | list< T > & | l, |
| T | t | ||
| ) |
| void replace | ( | list< T > & | l, |
| int | p, | ||
| T | t | ||
| ) |
| shape::edge_set<K>* mmx::shape::selfintersection | ( | const shape::surface_parametric< K > * | surf | ) |
Definition at line 50 of file ssi_surface_parametric.hpp.
References Edge, EdgeSet, dsearch::lefts, dsearch::nbcurves, and dsearch::sizes.
{
typedef typename EdgeSet::Point Point;
typedef typename EdgeSet::Edge Edge;
typedef typename EdgeSet::PointIterator PointIterator;
shape_ssi::dsearch ds(surf,200,200) ;
int nbv, nbi, a, c, s ;
for(nbv = 0, nbi = 0, c = 0 ; c < (int)ds.nbcurves ; c++)
{
s = ds.sizes[c];
nbv += s;
nbi += (s-2)*2+2;
}
EdgeSet * result = new EdgeSet(nbv);
// SelfIntersectionResult * result = new SelfIntersectionResult(IGLGood::E_LINE, nbv, nbi, (int)ds.nbcurves);
fxv<double,2> * prms = new fxv<double,2>[nbv];
a = 0;
for(c = 0 ; c < (int)ds.nbcurves ; c++) {
// result->lprm->params[c].size = (int)ds.sizes[c] ;
// result->rprm->params[c].size = (int)ds.sizes[c] ;
// result->lprm->params[c].prms = new fxv<double, 2>[(int)ds.sizes[c]] ;
// result->rprm->params[c].prms = new fxv<double, 2>[(int)ds.sizes[c]] ;
for(int i = 0 ; i < (int)ds.sizes[c] ; i++, a++) {
prms[a] = ds.lefts[c][i] ;
// result->lprm->params[c].prms[i] = ds.lefts[c][i] ;
// result->rprm->params[c].prms[i] = ds.rights[c][i] ;
}
}
PointIterator p=result->begin();
for(int i=0; i< nbv; i++,p++)
surf->eval(*p,prms[i][0],prms[i][1]) ;
// int ci = 0 ;
a = 0 ;
Point * p1, * p2;
for(c = 0 ; c < (int)ds.nbcurves ; c++) {
for(int i = 0 ; i < (int)ds.sizes[c]-1 ; i++, a++) {
// result->glg->indexes[ci] = a;
// result->glg->indexes[ci+1] = a+1;
// ci += 2;
p1= &result->vertex(a);
p2= &result->vertex(a+1);
result->push_edge(new Edge(p1,p2));
}
a++;
}
return result;
}
| unsigned mmx::shape::soft_hash | ( | const shape::bounding_box< double, shape::MGXK > & | m | ) | [inline] |
| unsigned mmx::shape::soft_hash | ( | const shape::point< C > & | m | ) | [inline] |
| unsigned mmx::shape::soft_hash | ( | const shape::algebraic_curve< rational, shape::MGXK > & | m | ) | [inline] |
| unsigned mmx::shape::soft_hash | ( | const shape::point_set< C, shape::with_color< V > > & | m | ) | [inline] |
| unsigned mmx::shape::soft_hash | ( | const shape::ImplicitCurve & | m | ) | [inline] |
| unsigned mmx::shape::soft_hash | ( | const shape::curve_rational< rational, shape::MGXK > & | m | ) | [inline] |
| unsigned mmx::shape::soft_hash | ( | const shape::surface_algebraic< rational, shape::MGXK > & | m | ) | [inline] |
| unsigned mmx::shape::soft_hash | ( | const shape::viewer< shape::axel, K > & | m | ) | [inline] |
| unsigned mmx::shape::soft_hash | ( | const shape::color< shape::MGXK > & | m | ) | [inline] |
| double mmx::shape::upper | ( | const bounding_box< C, V > & | bx, |
| int | v | ||
| ) | [inline] |
Definition at line 125 of file bounding_box.hpp.
Referenced by solver_implicit< C, V >::common_edge_point(), mmx::create_curve_rational(), solver_implicit< C, V >::edge_point(), plot(), point_on_edge(), and cell2d_voronoi_diagram< C, V >::subdivide().
{
switch(v) {
case 0:
return bx.xmax(); break ;
case 1:
return bx.ymax(); break ;
default:
return bx.zmax(); break ;
}
}
| double mmx::shape::upper | ( | double | x | ) | [inline] |
Definition at line 33 of file solver_implicit.hpp.
{return x;}
| void mmx::shape::write_edge | ( | gNode< T > * | v | ) |
| void mmx::shape::write_ok | ( | gNode< T > * | v | ) |
Definition at line 25 of file semialgebraic_domain2d_axel.hpp.
{
std::cout<<"Ok"<<std::endl;
}
{
0x0 , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c,
0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00,
0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c,
0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90,
0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c,
0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30,
0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac,
0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0,
0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c,
0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60,
0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc,
0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0,
0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c,
0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950,
0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc ,
0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0,
0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc,
0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0,
0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c,
0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650,
0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc,
0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0,
0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c,
0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460,
0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac,
0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0,
0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c,
0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230,
0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c,
0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190,
0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c,
0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0}
Definition at line 6 of file marching_cube.cpp.
Referenced by marching_cube::centralise(), and marching_cube::polygonise().
Definition at line 40 of file marching_cube.cpp.
Referenced by marching_cube::centralise(), and marching_cube::polygonise().