cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
prmTransformationManager.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5  Author(s): Rajesh Kumar, Anton Deguet
6  Created on: 2008-03-03
7 
8  (C) Copyright 2003-2008 Johns Hopkins University (JHU), All Rights
9  Reserved.
10 
11  --- begin cisst license - do not edit ---
12 
13  This software is provided "as is" under an open source license, with
14  no warranty. The complete license can be found in license.txt and
15  http://www.cisst.org/cisst/license.txt.
16 
17  --- end cisst license ---
18 */
19 
26 // transformation base and derived classes
29 
30 // Always include last
32 
76 #ifndef _prmTransformationManager_h
77 #define _prmTransformationManager_h
78 
79 
81 {
83  friend class prmTransformationBase;
84 
85 public:
86  typedef std::list<prmTransformationBasePtr> NodeListType;
87 
88 protected:
94 
102  static bool Attach(const prmTransformationBasePtr & attachPoint, const prmTransformationBasePtr & newFrame);
103  static bool Attach(const std::string & parentName, const prmTransformationBasePtr & newFrame);
104 
110  static bool Detach(const prmTransformationBasePtr & frame);
111 
112 public:
113 
114 
119 
124  static void Clear();
125 
134  static bool NodeCreatesCycle(const prmTransformationBasePtr & attachPoint, const prmTransformationBasePtr & newFrame);
135  static bool NodeCreatesCycle(const std::string & pName, const prmTransformationBasePtr & newFrame);
136 
146  static vctFrm3 WRTReference(const prmTransformationBasePtr & tipFrame, const prmTransformationBasePtr & refFrame);
147 
156  static unsigned int ReplaceReference(const prmTransformationBasePtr & nodePtr, const prmTransformationBasePtr & newReference);
157  static unsigned int ReplaceReference(const prmTransformationBasePtr & nodePtr, const std::string & parentName);
158 
167  static void ToStreamDot(std::ostream & outputStream);
171  static void ToStreamDotHelper(std::ostream & outputStream, prmTransformationBasePtr parent);
172 
177  static bool FindPath(const prmTransformationBasePtr & target, const prmTransformationBasePtr & reference);
178 
183  static bool FindPathConnectedTree(const prmTransformationBasePtr & target, const prmTransformationBasePtr & reference);
184 
187  static prmTransformationBasePtr GetTransformationNodePtr(const std::string pName);
188 
192  //return path and take path here. If you throw away the path, then its lost.
193  //make this thread safe
194  //check ofri's old code to see if any other ideas were missed.
195  static void PathToStreamDot(std::ostream & outputStream);
196 
197 }; /* prmTransformationManager */
198 
200 
202 
209 {
210  return prmTransformationManager::WRTReference(tipFrame, refFrame);
211 }
212 
219 {
221 }
222 
228 inline vctFrm3 prmWRTReference(const std::string & tipFrame, const std::string & refFrame)
229 {
233 }
234 
241 inline vctFrm3 prmWRTReference(const std::string & tipFrame, const prmTransformationBasePtr & refFrame)
242 {
244  return prmTransformationManager::WRTReference(tf1, refFrame);
245 }
251 inline vctFrm3 prmWRTReference(const prmTransformationBasePtr & tipFrame, const std::string & refFrame)
252 {
254  return prmTransformationManager::WRTReference(tipFrame, rf1);
255 }
256 
257 #endif // _prmTransformationManager_h
258 
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
virtual vctFrm3 WRTReference(void) const =0
static prmTransformationBasePtr GetTransformationNodePtr(const std::string pName)
static NodeListType VisitedNodes2
Definition: prmTransformationManager.h:93
Declaration of prmTransformationFixed.
static prmTransformationFixed TheWorld
Definition: prmTransformationManager.h:118
std::list< prmTransformationBasePtr > NodeListType
Definition: prmTransformationManager.h:86
Base class for high level objects.
Definition: cmnGenericObject.h:51
vctFrm3 prmWRTWorld(const prmTransformationBasePtr &frame)
Definition: prmTransformationManager.h:218
vctFrm3 prmWRTReference(const prmTransformationBasePtr &tipFrame, const prmTransformationBasePtr &refFrame)
Definition: prmTransformationManager.h:208
CMN_DECLARE_SERVICES_INSTANTIATION(prmTransformationManager)
static NodeListType Path
Definition: prmTransformationManager.h:90
Definition: prmTransformationFixed.h:42
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
Transformation base class.
Definition: prmTransformationBase.h:69
static vctFrm3 WRTReference(const prmTransformationBasePtr &tipFrame, const prmTransformationBasePtr &refFrame)
static NodeListType VisitedNodes
Definition: prmTransformationManager.h:92
Definition: prmTransformationManager.h:80
const int CMN_NO_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:328
#define CMN_LOG_ALLOW_DEFAULT
Definition: cmnLogLoD.h:76