48 #include <Inventor/nodekits/SoShapeKit.h> 58 #define VF_NAME_SZ 15 // max # of chars in a Face or Vertex name (incl. \0) 59 #define PTREE_NAME_SZ 80 // max # of chars in a PolyTree name (including \0) 66 #define MAX_VERTS_PER_FACE 100 77 void set(T *p) {ptr = p;}
98 if (ptr && --ptr->handleCount == 0)
delete ptr;
124 #define FOR_EACH(list, iterator) \ 125 for(iterator = (list).begin(); iterator != (list).end(); ++iterator) 149 #define VCLIP_MATRIX_POSE 0 151 #if VCLIP_MATRIX_POSE 184 {normal_ = normal; offset_ = - Vect3::dot(thruPoint, normal);}
188 {
return Vect3::dot(normal_, point) + offset_;}
190 ostream&
print(ostream &os)
const;
205 ostream&
print(ostream &os)
const;
218 ostream&
print(ostream &os)
const;
238 virtual const char *
name()
const = 0;
256 {
return ptree1 < ptree2;}
266 struct PolyTreePairHasher : unary_function<PolyTreePair, size_t> {
268 {
return ((
size_t) ptrees.
first)
270 ^ (((
unsigned int) ptrees.
second) >> 16);}
275 std::map<PolyTreePair, FeaturePair>
294 const char *
name()
const;
320 const char *
name()
const;
344 const char *
name()
const;
370 const VclipPose &X12,
const VclipPose &X21,
374 const VclipPose &Xvf,
const list<Face> &allFaces,
379 const VclipPose &Xve,
const VclipPose &Xev,
386 const VclipPose &X12,
const VclipPose &X21,
395 const VclipPose &X12,
const VclipPose &X21,
400 SoShapeKit *buildInvModel()
const;
409 void addFace(
const char *name,
410 vector<Vertex *> &verts,
int clockwise = 0);
415 ostream&
print(ostream &os)
const;
416 const list<Vertex> &
verts()
const {
return verts_;}
417 const list<Edge > &
edges()
const {
return edges_;}
418 const list<Face > &
faces()
const {
return faces_;}
493 void printRecur(ostream &os,
int level)
const;
507 void xform(
const Se3 &T);
511 int numNodes()
const;
512 int numLeaves()
const;
513 ostream&
print(ostream &os)
const;
516 SoNode *buildInvModel()
const;
531 const VclipPose &Xr1r2,
const VclipPose &Xr2r1,
541 const VclipPose &Xr1r2,
547 return vclip_(ptree1, ptree2, Xr1r2, Xr2r1, ht, cp1, cp2);
553 static void vclipFeatures(
569 list< Handle<PolyTree> >
lib;
574 int size() {
return lib.size();}
583 {
const PolyTree *pt;
return (pt = lookup(name)) ?
new PolyTree(*pt) : NULL;}
597 {
return vcn.
print(os);}
599 {
return fcn.
print(os);}
601 {
return poly->
print(os);}
603 {
return pt->
print(os);}
612 Vertex *Polyhedron::addVertex(
const char *name,
const Vect3 &coords)
616 strcpy(v.
name_, name);
618 return &verts_.back();
631 #endif // #ifndef VCLIP_H void setPoly(Polyhedron *p)
int operator==(const PolyTreePair &ptree1, const PolyTreePair &ptree2)
PolyTree * create(int i) const
const list< Vertex > & verts() const
ShareHandle< Polyhedron > poly_
ostream & print(ostream &os) const
png_infop png_charpp name
list< Handle< PolyTree > > components
const Vect3 & coords() const
const class PolyTree * first
const Polyhedron * poly() const
const list< Face > & faces() const
const Vect3 & mov2() const
ROSCONSOLE_DECL void print(FilterBase *filter, void *logger, Level level, const char *file, int line, const char *function, const char *fmt,...) ROSCONSOLE_PRINTF_ATTRIBUTE(7
PolyTree * create(const char *name) const
ostream & operator<<(ostream &os, const PolyTree *pt)
int loadPolyTreeFile(const char *fname, PolyTreeLibrary &library)
void invert(const Se3 &T)
const Vect3 & mov1() const
const Vect3 & normal() const
ostream & print(ostream &os) const
ostream & print(ostream &os) const
ostream & print(ostream &os) const
char VertFaceName[VF_NAME_SZ]
const T & operator*() const
static Real vclip(const PolyTree *const ptree1, const PolyTree *const ptree2, const VclipPose &Xr1r2, ClosestFeaturesHT &ht, Vect3 &cp1, Vect3 &cp2)
const Vect3 & pov() const
ShareHandle(const ShareHandle &orig)
ShareHandle & operator=(const ShareHandle &orig)
list< VertConeNode > cone
Real dist(const Vect3 &point) const
std::map< PolyTreePair, FeaturePair > ClosestFeaturesHT
const T * operator->() const
void addComponent(PolyTree *comp)
const Real & offset() const
list< Handle< PolyTree > > lib
ostream & print(ostream &os) const
const list< Edge > & edges() const
const class PolyTree * second
list< FaceConeNode > cone
const T * operator->() const
const T & operator*() const
int operator<(const PolyTreePair &ptree1, const PolyTreePair &ptree2)