link.h
Go to the documentation of this file.
1 #ifndef LINKH
2 #define LINKH
3 
4 #include "vector.h"
5 #include "interval.h"
6 #include "equation.h"
7 #include "cuiksystem.h"
8 #include "box.h"
9 #include "polyhedron.h"
10 #include "plot3d.h"
11 #include "color.h"
12 #include "htransform.h"
13 #include "parameters.h"
14 
15 #include <stdlib.h>
16 
35 #define ROT_REDUNDANCY 0
36 
37 /************************************************************************************/
45 #define INIT_NUM_SHAPES 2
46 /****************************************************************************/
53 #define DLC_R 0.5
54 
61 #define DLC_G 0.5
62 
69 #define DLC_B 0
70 
71 /************************************************************************************/
72 
79 #define IsGroundLink(id) (id==0)
80 
89 typedef struct {
90  char *name;
92  double s;
97  double c;
129  boolean allSpheres;
134  unsigned int axisID[3];
140  double maxCoord;
147  unsigned int *vID;
148  unsigned int nvID;
150 } Tlink;
151 
160 void InitLink(char *name,Tlink *l);
161 
170 void CopyLink(Tlink *l_dst,Tlink *l_src);
171 
180 void AddBody2Link(Tpolyhedron *b,Tlink *l);
181 
214 void ChangeLinkReferenceFrame(unsigned int r,double **p1,double **p2,Tlink *l);
215 
225 unsigned int LinkNBodies(Tlink *l);
226 
236 unsigned int LinkNAtoms(Tlink *l);
237 
238 
252 Tpolyhedron *GetLinkBody(unsigned int i,Tlink *l);
253 
268 unsigned int GetLinkBodyStatus(unsigned int i,Tlink *l);
269 
278 char *GetLinkName(Tlink *l);
279 
294 boolean IsLinkAllSpheres(Tlink *l);
295 
296 
308 void SetPoseVars(Tparameters *p,boolean *vars,TCuikSystem *cs,Tlink *l);
309 
325 void SetTransVars(boolean *vars,TCuikSystem *cs,Tlink *l);
326 
327 
342 void SetRotVars(Tparameters *p,boolean *vars,TCuikSystem *cs,Tlink *l);
343 
344 
359 void GetLinkPoseSimpVars(Tparameters *p,boolean *sv,TCuikSystem *cs,Tlink *l);
360 
385 void GenerateLinkRot(Tparameters *p,unsigned int lID,TCuikSystem *cs,Tlink *l);
386 
399 void GenerateLinkRotLinks(Tparameters *p,unsigned int lID,TCuikSystem *cs,Tlink *l);
400 
413 void GenerateLinkRotFLinks(Tparameters *p,unsigned int lID,TCuikSystem *cs,Tlink *l);
414 
415 
428 void GenerateLinkRotQLinks(Tparameters *p,unsigned int lID,TCuikSystem *cs,Tlink *l);
429 
459 void ApplyLinkRot(Tparameters *pr,double sf,unsigned int sv,double *p,Tequation *eq,
460  TCuikSystem *cs,boolean groundLink,Tlink *l);
461 
484 void ApplyLinkRotVar(Tparameters *pr,double sf,unsigned int *vID,Tequation *eq,
485  TCuikSystem *cs,boolean groundLink,Tlink *l);
486 
510 void ApplyLinkRotLinks(double sf,unsigned int sv,double *p,Tequation *eq,
511  TCuikSystem *cs,boolean groundLink,Tlink *l);
512 
536 void ApplyLinkRotFLinks(double sf,unsigned int sv,double *p,Tequation *eq,
537  TCuikSystem *cs,boolean groundLink,Tlink *l);
538 
562 void ApplyLinkRotQLinks(double sf,unsigned int sv,double *p,Tequation *eq,
563  TCuikSystem *cs,boolean groundLink,Tlink *l);
564 
588 void RegenerateLinkSolution(Tparameters *p,TCuikSystem *cs,double *sol,
589  boolean groundLink,Tlink *l);
590 
608 void RegenerateLinkSolutionLinks(TCuikSystem *cs,double *sol,boolean groundLink,Tlink *l);
609 
627 void RegenerateLinkSolutionQLinks(TCuikSystem *cs,double *sol,boolean groundLink,Tlink *l);
628 
650  boolean groundLink,Tlink *l);
651 
669 void RegenerateLinkBoxLinks(TCuikSystem *cs,Tbox *b,boolean groundLink,Tlink *l);
670 
688 void RegenerateLinkBoxQLinks(TCuikSystem *cs,Tbox *b,boolean groundLink,Tlink *l);
689 
712 void GetTransform2Link(Tparameters *p,TCuikSystem *cs,double *sol,boolean groundLink,
713  double *trans,THTransform *t,Tlink *l);
714 
736 void GetTransform2LinkLinks(TCuikSystem *cs,double *sol,boolean groundLink,
737  double *trans,THTransform *t,Tlink *l);
738 
760 void GetTransform2LinkFLinks(TCuikSystem *cs,double *sol,boolean groundLink,
761  double *trans,THTransform *t,Tlink *l);
762 
784 void GetTransform2LinkQLinks(TCuikSystem *cs,double *sol,boolean groundLink,
785  double *trans,THTransform *t,Tlink *l);
786 
802  double *sol,boolean groundLink,Tlink *l);
803 
816  double *sol,boolean groundLink,Tlink *l);
817 
830  double *sol,boolean groundLink,Tlink *l);
831 
844  double *sol,boolean groundLink,Tlink *l);
845 
856 boolean VisibleLink(Tlink *l);
857 
872 double GetLinkMaxCoordinate(Tlink *l);
873 
886 void LinkPrintAtoms(FILE *f,THTransform *tl,Tlink *l);
887 
900 void LinkStoreAtoms(FILE *f,THTransform *tl,Tlink *l);
901 
916 void PlotLink(Tplot3d *pt,double axesLength,Tlink *l);
917 
918 
934 
947 void PrintLink(FILE *f,char *path,char *prefix,Tlink *l);
948 
956 void DeleteLink(Tlink *l);
957 
958 #endif
Definition of the Tequation type and the associated functions.
A homgeneous transform in R^3.
Definition of the Tplot3d type and the associated functions.
A polyhedron.
Definition: polyhedron.h:124
A 3D plot.
Definition: plot3d.h:54
An equation.
Definition: equation.h:236
Definition of the Tbox type and the associated functions.
A table of parameters.
Definition of the TCuikSystem type and the associated functions.
Definition of the THTransform type and the associated functions.
A generic vector.
Definition: vector.h:227
A box.
Definition: box.h:83
Definition of the Tpolyhedron type and the associated functions.
A cuiksystem, i.e., a set of variables and equations defining a position analysis problem...
Definition: cuiksystem.h:181
Definition of the Tcolor type and the associated functions.
Definition of the Tvector type and the associated functions.
Definition of the Tparameters type and the associated functions.
Definition of the Tinterval type and the associated functions.