enum FoldType { FoldUp, FoldDown, TuckIn, BendUp, BendDown, Bend, Undecided }; class Fold{ public: // for pick class Vertex *vertex; int vertexID; class Face *face; int faceID; class FaceGroup *faceGroup; // for move Vector destination; FoldType type; Plane boundary; Line axis; double angle; // for animation Vector destination2; FoldType type2; Plane boundary2; Line axis2; double angle2; // pick bool setPick(Face &face); // face.h bool setPick( FaceGroup &faceGroup, Vector &viewDirection ); // facegroup.h Vector pickedVertexPosition(); // vertex.h // update bool update( double margin=0.1 ); bool isBend(){ return type == BendUp || type == BendDown; } bool update( Vector &destination, Vector &eyePosition, bool inBending ); bool update( Vector &destination ){ this->destination = destination; return this->update(); } // renew FaceGroup *pickedFaceGroup(){ return faceGroup; } Face *pickedFace(){ return face; } enum VertexLabel vertexLabel( Vector &position, double margin ); // vertex.h Vector newVertexPosition( Vector &v1, Vector &v2 ){ Line edge( v1, v2 ); Vector position; position.intersection( boundary, edge ); return position; } Vector rotateVertexPosition( Vector &v ){ Vector position; position.rotate( v, axis, angle ); return position; } Vector rotateNormal( Vector &normal ){ normal.print(); axis.print(); Vector v1, v2, vo(0,0,0); v2.rotate( normal, axis, angle ); v1.rotate( vo, axis, angle ); vo = v2 - v1; v2.print(); v1.print(); return vo; } // file io void save( FILE *fp ); bool load( FILE *fp, FaceGroup ** &faceGroup ); // animation void backup(){ destination2 = destination; type2 = type; boundary2 = boundary; axis2 = axis; angle2 = angle; } void modify( double position ); // vertex.h void print(); };