openscenegraph
AntiSquish
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13//osgDragger - Copyright (C) 2007 Fugro-Jason B.V.
14
15#ifndef _OSG_ANTISQUISH_
16#define _OSG_ANTISQUISH_ 1
17
18#include <osgManipulator/Export>
19
20#include <osg/Transform>
21#include <OpenThreads/Mutex>
22
23namespace osgManipulator {
24
29{
30 public :
32 AntiSquish(const osg::Vec3d& pivot);
33 AntiSquish(const osg::Vec3d& pivot, const osg::Vec3d& position);
35
36 virtual osg::Object* cloneType() const { return new AntiSquish(); }
37
38 virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new AntiSquish (*this,copyop); }
39
40 virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const AntiSquish *>(obj)!=NULL; }
41
42 virtual const char* libraryName() const { return "osgManipulator"; }
43
44 virtual const char* className() const { return "AntiSquish"; }
45
46
47 void setPivot(const osg::Vec3d& pvt)
48 {
49 _pivot = pvt;
50 _usePivot = true;
51 _cacheDirty = true;
52 }
53
54 const osg::Vec3d& getPivot() const { return _pivot; }
55
56 void setPosition(const osg::Vec3d& pos)
57 {
58 _position = pos;
59 _usePosition = true;
60 _cacheDirty = true;
61 }
62
63 const osg::Vec3d& getPosition() const { return _position; }
64
67
68 protected:
69
70 virtual ~AntiSquish();
71
73
76
79
81 mutable bool _cacheDirty;
84};
85
86}
87#endif
This class provides an object-oriented thread mutex interface.
Definition Mutex:31
Definition AntiSquish:29
virtual osg::Object * clone(const osg::CopyOp &copyop) const
Definition AntiSquish:38
osg::Vec3d _position
Definition AntiSquish:77
AntiSquish(const osg::Vec3d &pivot, const osg::Vec3d &position)
bool computeUnSquishedMatrix(osg::Matrix &) const
osg::Matrix _cacheLocalToWorld
Definition AntiSquish:82
void setPosition(const osg::Vec3d &pos)
Definition AntiSquish:56
OpenThreads::Mutex _cacheLock
Definition AntiSquish:80
virtual osg::Object * cloneType() const
Definition AntiSquish:36
bool computeWorldToLocalMatrix(osg::Matrix &matrix, osg::NodeVisitor *) const
void setPivot(const osg::Vec3d &pvt)
Definition AntiSquish:47
const osg::Vec3d & getPosition() const
Definition AntiSquish:63
AntiSquish(const AntiSquish &pat, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osg::Vec3d _pivot
Definition AntiSquish:74
virtual bool isSameKindAs(const osg::Object *obj) const
Definition AntiSquish:40
bool _usePivot
Definition AntiSquish:75
virtual const char * libraryName() const
Definition AntiSquish:42
virtual const char * className() const
Definition AntiSquish:44
osg::Matrix _cache
Definition AntiSquish:83
const osg::Vec3d & getPivot() const
Definition AntiSquish:54
bool _cacheDirty
Definition AntiSquish:81
bool _usePosition
Definition AntiSquish:78
bool computeLocalToWorldMatrix(osg::Matrix &matrix, osg::NodeVisitor *) const
AntiSquish(const osg::Vec3d &pivot)
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Definition Matrixd:27
Definition NodeVisitor:82
Definition Object:61
Definition Transform:75
Definition Vec3d:30
Definition AntiSquish:23
#define OSGMANIPULATOR_EXPORT
Definition osgManipulator/Export:27
#define NULL
Definition osg/Export:55