|
|
cpolyhedron.c File ReferenceImplementaton of the function operating on Tcpolyhedron. More... #include "cpolyhedron.h" #include "htransform.h" #include "error.h" #include <string.h> #include <math.h> Go to the source code of this file.
Detailed DescriptionImplementaton of the function operating on Tcpolyhedron.
Definition in file cpolyhedron.c. Function Documentation
Constructs a convex polyhedrom from a file. This function is to be used when the heading of the file is already processed and the file includes for sure the definition of an OFF.
Definition at line 90 of file cpolyhedron.c. References Tcpolyhedron::center, Error(), Tcpolyhedron::fv, Tcpolyhedron::maxCoord, Tcpolyhedron::ne, NEW, Tcpolyhedron::nf, Tcpolyhedron::nv, Tcpolyhedron::nvf, OFF, Tcpolyhedron::p1, Tcpolyhedron::p2, Tcpolyhedron::rad, Tcpolyhedron::type, and Tcpolyhedron::v. Referenced by InitCPolyhedronFromFile().
Here is the call graph for this function:
Here is the caller graph for this function:
Generates and OFF that approximates a cylinder. This polyhedric approximation is the one used int collision detection. Note that only the vertexes of the OFFS are generates (no face information is created) since for collision detection only the vertexes of the convex polyhedrons are used.
Definition at line 146 of file cpolyhedron.c. References CYLINDER, Error(), Tcpolyhedron::fv, HTransformApply(), HTransformDelete(), HTransformX2Vect(), M_2PI, Tcpolyhedron::maxCoord, NEW, Tcpolyhedron::nf, Tcpolyhedron::nv, Tcpolyhedron::nvf, Tcpolyhedron::p1, Tcpolyhedron::p2, Tcpolyhedron::rad, Tcpolyhedron::type, and Tcpolyhedron::v. Referenced by NewCylinder(), and ReadCylinder().
Here is the call graph for this function:
Here is the caller graph for this function:
Constructs a convex polyhedrom from a file. This function is to be used when the heading of the file is already processed and the file includes for sure the definition of an CYLINDER.
Definition at line 199 of file cpolyhedron.c. References Tcpolyhedron::center, CYLINDER, GenerateCylinderOFF(), Tcpolyhedron::p1, Tcpolyhedron::p2, Tcpolyhedron::rad, and Tcpolyhedron::type. Referenced by InitCPolyhedronFromFile().
Here is the call graph for this function:
Here is the caller graph for this function:
Generates and OFF that approximates a sphere. This polyhedric approximation is the one used int collision detection. Note that only the vertexes of the OFFS are generates (no face information is created) since for collision detection only the vertexes of the convex polyhedrons are used.
Definition at line 220 of file cpolyhedron.c. References Tcpolyhedron::center, Error(), Tcpolyhedron::fv, HTransformApply(), HTransformDelete(), HTransformProduct(), HTransformRz(), HTransformTxyz(), M_2PI, M_PI_2, Tcpolyhedron::maxCoord, NEW, Tcpolyhedron::nf, Tcpolyhedron::nv, Tcpolyhedron::nvf, Tcpolyhedron::rad, SPHERE, Tcpolyhedron::type, and Tcpolyhedron::v. Referenced by NewSphere(), and ReadSphere().
Here is the call graph for this function:
Here is the caller graph for this function:
Constructs a convex polyhedrom from a file. This function is to be used when the heading of the file is already processed and the file includes for sure the definition of an SPHERE.
Definition at line 296 of file cpolyhedron.c. References Tcpolyhedron::center, GenerateSphereOFF(), Tcpolyhedron::p1, Tcpolyhedron::p2, Tcpolyhedron::rad, SPHERE, and Tcpolyhedron::type. Referenced by InitCPolyhedronFromFile().
Here is the call graph for this function:
Here is the caller graph for this function:
Define a Tcpolyhedron from a file.
Definition at line 314 of file cpolyhedron.c. References Tcpolyhedron::color, CopyColor(), Error(), NEW, NO_UINT, Tcpolyhedron::obj3d, ReadCylinder(), ReadOFF(), and ReadSphere(). Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
Defines a sphere (and its polyhedric approximation for collision detection).
Definition at line 353 of file cpolyhedron.c. References Tcpolyhedron::center, Tcpolyhedron::color, CopyColor(), GenerateSphereOFF(), NO_UINT, Tcpolyhedron::obj3d, Tcpolyhedron::p1, Tcpolyhedron::p2, Tcpolyhedron::rad, SPHERE, and Tcpolyhedron::type.
Here is the call graph for this function:
Defines a cylinder (and its polyhedric approximation for collision detection).
Definition at line 376 of file cpolyhedron.c. References Tcpolyhedron::center, Tcpolyhedron::color, CopyColor(), CYLINDER, GenerateCylinderOFF(), NO_UINT, Tcpolyhedron::obj3d, Tcpolyhedron::p1, Tcpolyhedron::p2, Tcpolyhedron::rad, and Tcpolyhedron::type.
Here is the call graph for this function:
Defines a polyhedron from another polyhedron.
Definition at line 403 of file cpolyhedron.c. References Tcpolyhedron::center, Tcpolyhedron::color, CopyColor(), Tcpolyhedron::fv, Tcpolyhedron::maxCoord, Tcpolyhedron::ne, NEW, Tcpolyhedron::nf, Tcpolyhedron::nv, Tcpolyhedron::nvf, Tcpolyhedron::obj3d, Tcpolyhedron::p1, Tcpolyhedron::p2, Tcpolyhedron::rad, Tcpolyhedron::type, and Tcpolyhedron::v. Referenced by AddBody2Link().
Here is the call graph for this function:
Here is the caller graph for this function:
Applies a homogenoeus transform to a convex polyhedron.
Definition at line 451 of file cpolyhedron.c. References Tcpolyhedron::center, HTransformApply(), Tcpolyhedron::maxCoord, Tcpolyhedron::nv, Tcpolyhedron::p1, Tcpolyhedron::p2, and Tcpolyhedron::v. Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
Retrives the type of a convex polyhedron.
Definition at line 475 of file cpolyhedron.c. References Tcpolyhedron::type.
Changes the color of a convex polyhedron.
Definition at line 480 of file cpolyhedron.c. References Tcpolyhedron::color, and CopyColor().
Here is the call graph for this function:
Gets the color of a convex polyhedron.
Definition at line 485 of file cpolyhedron.c. References Tcpolyhedron::color, and CopyColor().
Here is the call graph for this function:
Gets the number of vertexes of a convex polyhedron.
Definition at line 490 of file cpolyhedron.c. References Tcpolyhedron::nv.
Gets the coordinates of a point defining of a convex object. A CYLINDER is defined by two points: the initial and the end points of the cylinder. A SPHERE is defined by one point: the center of the sphere. For OFFs, all vertexes are considered defining points. If the convex polyhedron has less defining points than the requested number, this function triggers an error.
Definition at line 495 of file cpolyhedron.c. References Tcpolyhedron::center, CYLINDER, Error(), GetCPolyhedronVertex(), OFF, Tcpolyhedron::p1, Tcpolyhedron::p2, SPHERE, and Tcpolyhedron::type. Referenced by GetMechanismDefiningPoint().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns the radius used in the definition of the convex object. This function is only defined for SPHEREs and CYLINDERs. It triggers an error if used on a OFF.
Definition at line 535 of file cpolyhedron.c. References Error(), OFF, Tcpolyhedron::rad, and Tcpolyhedron::type.
Here is the call graph for this function:
Gets the coordinates of the vertex of a convex polyhedron. For cylinders and spheres point on the approximating OFF are returned. If the convex polyhedron has less vertexes than the requested element, this function triggers an error.
Definition at line 542 of file cpolyhedron.c. References Error(), Tcpolyhedron::nv, and Tcpolyhedron::v. Referenced by GetCPolyhedronDefiningPoint().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns the maximum coordinate value (either in X, Y, or Z) used in a convex polyhedron. This is used in higher levels to define an over-estimate bounding-box of the mechanism. This bounding box is used to define the ranges for some of the coordinate and separating planes variables.
Definition at line 553 of file cpolyhedron.c. References Tcpolyhedron::maxCoord. Referenced by AddBody2Link().
Here is the caller graph for this function:
Adds the convex polyhedron to a 3D geometry. Each object in a 3D scene gets an identifier that is stored in the cpolyhedron object for future reference.
Definition at line 558 of file cpolyhedron.c. References Tcpolyhedron::center, Close3dObject(), Tcpolyhedron::color, CYLINDER, Tcpolyhedron::fv, Tcpolyhedron::ne, Tcpolyhedron::nf, Tcpolyhedron::nv, Tcpolyhedron::nvf, Tcpolyhedron::obj3d, OFF, Tcpolyhedron::p1, Tcpolyhedron::p2, Plot3dObject(), PlotCylinder(), PlotSphere(), Tcpolyhedron::rad, SPHERE, StartNew3dObject(), Tcpolyhedron::type, and Tcpolyhedron::v. Referenced by PlotLink().
Here is the call graph for this function:
Here is the caller graph for this function:
Moves an object previously added to a 3D scene.
Definition at line 594 of file cpolyhedron.c. References Move3dObject(), NO_UINT, and Tcpolyhedron::obj3d. Referenced by MoveLink().
Here is the call graph for this function:
Here is the caller graph for this function:
Stores the geometic information of a convex polyhedron into a file. Basically, it creates a file that can be latter read using InitCPolyhedronFromFile
Definition at line 600 of file cpolyhedron.c. References Tcpolyhedron::center, CYLINDER, Error(), Tcpolyhedron::fv, Tcpolyhedron::nf, Tcpolyhedron::nv, Tcpolyhedron::nvf, OFF, Tcpolyhedron::p1, Tcpolyhedron::p2, Tcpolyhedron::rad, SPHERE, Tcpolyhedron::type, and Tcpolyhedron::v. Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
Deletes the information stored in a Tcpolyhedron and frees the allocated memory.
Definition at line 641 of file cpolyhedron.c. References Tcpolyhedron::fv, Tcpolyhedron::nf, Tcpolyhedron::nv, Tcpolyhedron::nvf, and Tcpolyhedron::v. Referenced by DeleteLink(), and main().
Here is the caller graph for this function:
|