filename.h File Reference

Detailed Description

Functions to deal with file names.

The main files used in the CuikSuite have the following extensions:

  • .world Used for files describing mechanisms (links + joints) plus obstacles. We can extract equation files from world files using cuikequations. The type of equations obtained depend on the representation used. The most common representations are LINKS (described here) and JOINTS (equivalent to the standard ). The first one is redundant (it uses more variables than degrees of freedom) and the second is not.
  • .cuik Files including variables and equations. The solution set of a cuik file can be obtained using cuik. This will produce a .sol file.
  • _simp.cuik Files including variables and equations for simplified systems. Simplified systems are obtained from .cuik systems using cuiksimplify
  • .param File with the parameters. The default set of parameters is in share/default.param
  • .sol Solution file resulting from cuik. These files include the solution set of a given system of equations in the form of boxes. Solution files can be represented graphicall using cuikplot3d
  • .links Initial and final configuration for path planning. This is used if the mechanisms is modelled using a redundant formulations (e.g., REPRESENTATION = LINKS).
  • .joints Initial and final configuration for path planning. This is used for non-redundant (e.g., REPRESENTATION = JOINTS) formulation. We can generate .joints files from .links using cuiklinks2joints. The inverse is obtained using cuikjoints2links. Joint values can be obtained interactively using cuikmove or the cuikexplore.
  • .path Solution of a path planning process.
  • .atlas File including an atlas describing a manifold. An atlas can be represented graphicaly using cuikplotatlas
  • .rrt File with an RRT derived during path planning. An atlas can be represented graphicaly using cuikplotrrt
  • .arrt File with the AtlasRRT information. Basically the information to coordinate a RRT and an Atlas.
  • .gcl Files with 3D geometry to be displayed with Geomview. This files are obtained using, for instance, cuikplot3d, cuikplotatlas, or cuikplotrrt.
  • .pdb Typical extension of files prividing molecular information (Protein Daba Bank file format).
  • .atom User provided atom 3d positions. If available, these positions are used to overide those in the pdb files which are given with low accuracy.
  • .tens Tensegrity structures.
See Also
filename.c Tfilename

Definition in file filename.h.

Data Structures

struct  Tfilename
 Data structure to hold the information about the name of a file. More...
 

Macros

#define CUIK_EXT   "cuik"
 File extension for equation files. More...
 
#define PDB_EXT   "pdb"
 Default file extension for bio-info files. More...
 
#define ATOM_EXT   "atoms"
 File extension for atom coordinates files. More...
 
#define RGROUPS_EXT   "rgroups"
 File extension for atom rigid groups. More...
 
#define OFF_EXT   "off"
 File extension for geomview OFF files. More...
 
#define SLAM_EXT   "slam"
 File extension for slam files. More...
 
#define CAD_EXT   "cad"
 File extension for CAD files. More...
 
#define URDF_EXT   "urdf"
 File extension for URDFs. More...
 
#define PARAM_EXT   "param"
 File extension for parameter files. More...
 
#define SOL_EXT   "sol"
 File extension for solution files. More...
 
#define SOL_WITH_DUMMIES_EXT   "dsol"
 File extension for solution files with dummies. More...
 
#define AXES_EXT   "axes"
 File extension for the mechanism axes. More...
 
#define COST_EXT   "cost"
 File extension for arrays of costs. More...
 
#define WORLD_EXT   "world"
 File extension for problem files. More...
 
#define PLOT3D_EXT   "gcl"
 File extension for 3D plot files. More...
 
#define PLOT2D_EXT   "fig"
 File extension for 2D plot files. More...
 
#define LINKS_EXT   "links"
 File extension for files with samples represented by the link poses. More...
 
#define JOINTS_EXT   "joints"
 File extension for files with samples represented by the joint values. More...
 
#define STATE_EXT   "state"
 File extension for files storing the interval solver state. More...
 
#define ATLAS_EXT   "atlas"
 File extension for files storing atlas. More...
 
#define ATLAS_GRAPH_EXT   "agraph"
 File extension for files atlas graph information. More...
 
#define RRT_EXT   "rrt"
 File extension for files storing rrt's. More...
 
#define ATLAS_RRT_EXT   "arrt"
 File extension for files storing AtlasRTT's. More...
 
#define RES_EXT   "res"
 File extension for files storing residue indentifiers. More...
 
#define RIGID_EXT   "rigids"
 File extension for files storing rigid part of molecules. More...
 
#define HINGE_EXT   "hinges"
 File extension for files storing the hinges of a molecule. More...
 
#define TENSEGRITY_EXT   "tens"
 File extension for files describing tensegrities. More...
 
#define FORCES_EXT   "forces"
 File extension for files including forces. More...
 

Functions

void CreateFileName (char *path, char *name, char *suffix, char *ext, Tfilename *fn)
 Constructor. More...
 
char * GetFileFullName (Tfilename *fn)
 Gets the file full name (paht+name+extension). More...
 
char * GetFilePath (Tfilename *fn)
 Gets the file path. More...
 
char * GetFileBaseName (Tfilename *fn)
 Gets the file base name (paht+name) . More...
 
char * GetFileName (Tfilename *fn)
 Gets the file name. More...
 
char * GetFileExtension (Tfilename *fn)
 Gets the file extension. More...
 
void LinkFileNameWithExtension (char *fn1, char *ext, Tfilename *fn2)
 Creates a link to a given filename. More...
 
void DeleteFileName (Tfilename *fn)
 Destructor. More...
 

Macro Definition Documentation

#define CUIK_EXT   "cuik"

File extension for equation files.

Definition at line 71 of file filename.h.

Referenced by InitCSWDFromFile(), main(), and PrintWorldCS().

#define PDB_EXT   "pdb"

Default extension for bio-info files (files including information about molecules). The system is interfaced with OpenBabel and, thus, we can manipulate many different types of bio-info files. The particular type to read/write is deduced from the file extension. If not given, though, 'pdb' is used.

Definition at line 81 of file filename.h.

Referenced by main().

#define ATOM_EXT   "atoms"

File extension for files giving atom 3D coordinates. This files are used, if available, to overide the atom position form pdb files, that are typically given with low accuracy.

Definition at line 89 of file filename.h.

Referenced by GetAtomPositions(), and main().

#define RGROUPS_EXT   "rgroups"

File extension for files giving rigid groups of atoms.

Definition at line 95 of file filename.h.

Referenced by main().

#define OFF_EXT   "off"

File extension for geomview OFF files. They include a description 3D geometry in the form of vertices and faces.

Definition at line 102 of file filename.h.

Referenced by PrintPolyhedron().

#define SLAM_EXT   "slam"

File extension for slam files. They include a description of the trajectory of a robot in 2D and the landmarks it observes.

Not used yet.

Definition at line 111 of file filename.h.

Referenced by main().

#define CAD_EXT   "cad"

File extension for CAD files. They include geometric constraints.

Not used yet.

Definition at line 119 of file filename.h.

Referenced by main().

#define URDF_EXT   "urdf"

File extension for URDFs: universal robot description files.

Definition at line 125 of file filename.h.

Referenced by main().

#define PARAM_EXT   "param"

File extension for parameter files.

Definition at line 132 of file filename.h.

Referenced by InitParametersFromFile(), and main().

#define SOL_EXT   "sol"
#define SOL_WITH_DUMMIES_EXT   "dsol"

File extension for solution files including dummy variables.

Definition at line 144 of file filename.h.

Referenced by main(), SaveChartCenters(), SaveRRTNodes(), and SaveSingularCharts().

#define AXES_EXT   "axes"

File extension for mechanism axes.

Definition at line 150 of file filename.h.

Referenced by main().

#define COST_EXT   "cost"

File extension for sets of costs. Used to colorize atlas.

Definition at line 156 of file filename.h.

Referenced by main(), and SaveRRTCosts().

#define WORLD_EXT   "world"

File extension for problem files.

Definition at line 162 of file filename.h.

Referenced by main(), and PrintWorld().

#define PLOT3D_EXT   "gcl"

File extension for 3D plot files.

Definition at line 168 of file filename.h.

Referenced by main(), PlotAtlasRRT(), PlotConnection(), and PlotQrand().

#define PLOT2D_EXT   "fig"

File extension for 2D plot files.

Definition at line 174 of file filename.h.

Referenced by main().

#define LINKS_EXT   "links"

File extension for files including samples represented giving poses for the links.

Definition at line 181 of file filename.h.

Referenced by IncrementalSampleCuikSystemInBox(), main(), on_cuikexplore_save(), ReadOneSample(), ReadTwoSamples(), and SampleCuikSystemInBox().

#define JOINTS_EXT   "joints"

File extension for files including samples represented giving values for the degrees of freedom.

Definition at line 188 of file filename.h.

Referenced by main(), on_cuikexplore_save(), on_cuikmove_save(), ReadOneSample(), and ReadTwoSamples().

#define STATE_EXT   "state"

File extension for files storing the interval solver state.

Definition at line 194 of file filename.h.

Referenced by main().

#define ATLAS_EXT   "atlas"

File extension for files storing atlas on manifolds.

Definition at line 200 of file filename.h.

Referenced by LoadAtlasRRT(), main(), and SaveAtlasRRT().

#define ATLAS_GRAPH_EXT   "agraph"

File extension for files storing neighbouring relation between the charts in an antals.

Definition at line 207 of file filename.h.

Referenced by SaveAtlasGraph().

#define RRT_EXT   "rrt"

File extension for files storing rrts on manifolds.

Definition at line 213 of file filename.h.

Referenced by LoadAtlasRRT(), main(), and SaveAtlasRRT().

#define ATLAS_RRT_EXT   "arrt"

File extension for files storing AtlasRRTs. These files store the information linking the RRT and the Atlas

Definition at line 220 of file filename.h.

Referenced by LoadAtlasRRT(), and SaveAtlasRRT().

#define RES_EXT   "res"

File extension for files storing the identifiers of the residues to be considered flexible in a given protein. If this file does not exits the degrees of freedom are deduced from the bond type (double bonds are fixed and single bonds allow for rotations).

Definition at line 229 of file filename.h.

Referenced by ReadResidueList().

#define RIGID_EXT   "rigids"

File extension for files storing the rigid parts of a given molecule The files include a list of atoms together with the identifier of the rigid including them, if any. Atoms in no rigid are assigned to 0.

Definition at line 237 of file filename.h.

Referenced by ReadRigidsAndHinges().

#define HINGE_EXT   "hinges"

File extension for files storing the hinges connecting the rigid parts of a given molecules. The hinges are a set of rotation between given pairs of atoms.

Definition at line 245 of file filename.h.

Referenced by ReadRigidsAndHinges().

#define TENSEGRITY_EXT   "tens"

File extension for files describing tensegrity structures.

Definition at line 251 of file filename.h.

#define FORCES_EXT   "forces"

File extension for files including foces. They are typically generated with the cuikworldforces application, processing a solution set (i.e., a solution path of a planning process).

Definition at line 260 of file filename.h.

Referenced by main().

Function Documentation

void CreateFileName ( char *  path,
char *  name,
char *  suffix,
char *  ext,
Tfilename fn 
)

Generates a Tfilename structure.

Parameters
pathThe path. If not given we get it from the system and is the path from of the directory from where the application is exeucted.
nameThe name of the file. If the given name includes part of a path, it is removed from the name and added to the path data field.
suffixA suffix to add to the name. Possibly NULL.
extThe extension for the file.
fnThe filename structure to create.

Definition at line 22 of file filename.c.

References Tfilename::baseName, Error(), Tfilename::ext, FALSE, Tfilename::fullName, Tfilename::name, NEW, and Tfilename::path.

Referenced by GetAtomPositions(), IncrementalSampleCuikSystemInBox(), InitCSWDFromFile(), InitParametersFromFile(), LinkFileNameWithExtension(), LoadAtlasRRT(), main(), on_cuikexplore_save(), on_cuikmove_save(), PlotAtlasRRT(), PlotConnection(), PlotQrand(), PrintPolyhedron(), PrintWorld(), PrintWorldCS(), ReadOneSample(), ReadResidueList(), ReadRigidsAndHinges(), ReadTwoSamples(), SampleCuikSystemInBox(), SaveAtlasGraph(), SaveAtlasRRT(), SaveChartCenters(), SaveRRTCosts(), SaveRRTNodes(), SaveSamples(), SaveSamplesN(), and SaveSingularCharts().

char* GetFilePath ( Tfilename fn)

Gets the file path.

Parameters
fnThe filename structure.
Returns
Returns the path for the file.

Definition at line 156 of file filename.c.

References Tfilename::path.

Referenced by LinkFileNameWithExtension(), on_cuikmove_save(), and PrintWorld().

char* GetFileBaseName ( Tfilename fn)

Gets the file base name (paht+name).

Parameters
fnThe filename structure.
Returns
Returns the base name (paht+name) for the file.

Definition at line 166 of file filename.c.

References Tfilename::baseName.

Referenced by main().

char* GetFileName ( Tfilename fn)

Gets the file name.

Parameters
fnThe filename structure.
Returns
Returns the name for the file.

Definition at line 161 of file filename.c.

References Tfilename::name.

Referenced by LinkFileNameWithExtension(), main(), and PrintWorld().

char* GetFileExtension ( Tfilename fn)

Gets the file extension.

Parameters
fnThe filename structure.
Returns
Returns the extension for the file.

Definition at line 171 of file filename.c.

References Tfilename::ext.

Referenced by InitPolyhedronFromFile(), and PrintWorld().

void LinkFileNameWithExtension ( char *  fn1,
char *  ext,
Tfilename fn2 
)

Creates a link to a given filename with a given extension.

Parameters
fn1File to link.
extExtension of the files.
fn2File name of the link.

Definition at line 177 of file filename.c.

References CreateFileName(), DeleteFileName(), GetFileFullName(), GetFileName(), and GetFilePath().

Referenced by main().