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 
31 class SbViewportRegion;
32 class SbVec2f;
33 
34 class COIN_DLL_API SoEvent {
35 
36 public:
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 
61 private:
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 SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition: SbVec2f.h:36
The SbTime class instances represents time values.SbTime is a convenient way of doing system independ...
Definition: SbTime.h:41
The SoEvent class is the base class for all Coin events.Coin contains its own set of event classes...
Definition: SoEvent.h:34
The SbViewportRegion class is a viewport within a full window.The SbViewportRegion class contains inf...
Definition: SbViewportRegion.h:31
The SbVec2s class is a 2 dimensional vector with short integer coordinates.This vector class is used ...
Definition: SbVec2s.h:37
The SoType class is the basis for the run-time type system in Coin.Many of the classes in the Coin li...
Definition: SoType.h:50

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

Generated on Fri Jul 20 2018 for Coin by Doxygen. 1.8.14