Coin Logo http://www.sim.no
http://www.coin3d.org

SoEvent.h
1#ifndef COIN_SOEVENT_H
2#define COIN_SOEVENT_H
3
4/**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Systems in Motion about acquiring
18 * a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25\**************************************************************************/
26
27#include <Inventor/SoType.h>
28#include <Inventor/SbVec2s.h>
29#include <Inventor/SbTime.h>
30
32class SbVec2f;
33
34class COIN_DLL_API SoEvent {
35
36public:
37 SoEvent(void);
38 virtual ~SoEvent();
39
40 SbBool isOfType(SoType type) const;
41 static SoType getClassTypeId(void);
42 virtual SoType getTypeId(void) const;
43
44 void setTime(const SbTime t);
45 SbTime getTime(void) const;
46
47 void setPosition(const SbVec2s & p);
48 const SbVec2s & getPosition(void) const;
49 const SbVec2s getPosition(const SbViewportRegion & vpRgn) const;
50 const SbVec2f getNormalizedPosition(const SbViewportRegion & vpRgn) const;
51
52 void setShiftDown(SbBool isDown);
53 SbBool wasShiftDown(void) const;
54 void setCtrlDown(SbBool isDown);
55 SbBool wasCtrlDown(void) const;
56 void setAltDown(SbBool isDown);
57 SbBool wasAltDown(void) const;
58
59 static void initClass(void);
60
61private:
62 static SoType classTypeId;
63
64 SbTime timeofevent;
65 SbVec2s positionofevent;
66
67 static void initEvents(void);
68
69 struct {
70 unsigned int shiftdown : 1;
71 unsigned int ctrldown : 1;
72 unsigned int altdown : 1;
73 } modifiers;
74};
75
76#endif // !COIN_SOEVENT_H
The SbTime class instances represents time values.
Definition SbTime.h:41
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition SbVec2f.h:36
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition SbVec2s.h:37
The SbViewportRegion class is a viewport within a full window.
Definition SbViewportRegion.h:31
The SoEvent class is the base class for all Coin events.
Definition SoEvent.h:34
The SoType class is the basis for the run-time type system in Coin.
Definition SoType.h:50

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Thu Jan 16 2025 for Coin by Doxygen. 1.12.0