Fawkes API  Fawkes Development Version
transformable.h
1 
2 /***************************************************************************
3  * transformable.h - Transformable interface
4  *
5  * Created: Thu Oct 02 16:53:27 2008
6  * Copyright 2008 Daniel Beck
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __GEOMETRY_TRANSFORMABLE_H_
25 #define __GEOMETRY_TRANSFORMABLE_H_
26 
27 #include <geometry/hom_transform.h>
28 #include <geometry/hom_coord.h>
29 
30 #include <vector>
31 
32 namespace fawkes {
33 
35 {
36  friend class HomTransform;
37 
38  public:
39  Transformable();
40  virtual ~Transformable();
41 
42  protected:
43  void transform(const HomTransform& t);
44  void add_primitive(HomCoord* c);
45  void clear_primitives();
46 
47  virtual void register_primitives() =0;
48  virtual void post_transform() =0;
49 
50  private:
51  std::vector<HomCoord*> m_primitives;
52 };
53 
54 }
55 
56 #endif /* __GEOMETRY_TRANSFORMABLE_H_ */
void transform(const HomTransform &t)
Apply the transform to all registered primitives and call the post_transform() method.
Transformable()
Constructor.
void clear_primitives()
Clear the list of primitives.
virtual ~Transformable()
Destructor.
Fawkes library namespace.
This class describes a homogeneous transformation.
Definition: hom_transform.h:31
Base class for homogeneous primitives (vector and point).
Definition: hom_coord.h:34
Interface class for all transformable objects.
Definition: transformable.h:34
virtual void register_primitives()=0
Here, a derived class should register its primitives (HomPoints and HomVectors) by calling add_primit...
void add_primitive(HomCoord *c)
Add a primitive to the list of primitives that is transformed.
virtual void post_transform()=0
This method is called after the primitives are transformed.