Open Inventor Reference
SoDirectionalLightManip.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * Further, this software is distributed without any warranty that it is
16  * free of the rightful claim of any third person regarding infringement
17  * or the like. Any license provided herein, whether implied or
18  * otherwise, applies only to this software file. Patent licenses, if
19  * any, provided herein do not apply to combinations of this program with
20  * other software, or any other product whatsoever.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *
26  * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
27  * Mountain View, CA 94043, or:
28  *
29  * http://www.sgi.com
30  *
31  * For further information regarding this notice, see:
32  *
33  * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
34  *
35  */
36 
37 
38 
39 /*
40  * Copyright (C) 1990,91 Silicon Graphics, Inc.
41  *
42  _______________________________________________________________________
43  ______________ S I L I C O N G R A P H I C S I N C . ____________
44  |
45  | $Revision: 1.1.1.1 $
46  |
47  | Description:
48  | This file defines a manipulator for a Point light nodes.
49  | It is subclassed from SoPointLight.
50  | Author(s): Paul Isaacs
51  |
52  ______________ S I L I C O N G R A P H I C S I N C . ____________
53  _______________________________________________________________________
54  */
55 
56 #ifndef _SO_DIRECTIONAL_LIGHT_MANIP_
57 #define _SO_DIRECTIONAL_LIGHT_MANIP_
58 
59 #include <Inventor/SbLinear.h>
63 
64 
65 
68 
165 
167 
169 
170  public:
173 
180 
203  bool replaceNode( SoPath *p );
222  bool replaceManip(SoPath *p, SoDirectionalLight *newOne ) const;
223 
224  SoEXTENDER public:
225 
231  virtual void doAction( SoAction *action );
232  virtual void callback( SoCallbackAction *action );
233  virtual void GLRender( SoGLRenderAction *action );
234  virtual void getBoundingBox( SoGetBoundingBoxAction *action );
235  virtual void getMatrix(SoGetMatrixAction *action );
236  virtual void handleEvent( SoHandleEventAction *action );
237  virtual void pick( SoPickAction *action );
238  virtual void search( SoSearchAction *action );
239 
240  SoINTERNAL public:
241  static void initClass();
242 
243  virtual SoChildList *getChildren() const;
244 
245  protected:
246 
248  virtual void copyContents(const SoFieldContainer *fromFC,
249  bool copyConnections);
250 
251  static void transferFieldValues( const SoDirectionalLight *from,
252  SoDirectionalLight *to);
253 
254  static void valueChangedCB(void *,SoDragger *);
255 
258  static void fieldSensorCB(void *, SoSensor *);
259 
260  void setDragger( SoDragger *newDragger );
261 
263 
265 
266  private:
267  int getNumChildren() const { return (children->getLength()); }
268 };
269 
270 #endif /* _SO_DIRECTIONAL_LIGHT_MANIP_ */
271 
272 
#define SoEXTENDER
Provide inline template functions for abs, swap, min, max, and clamp.
Definition: SbBasic.h:154
#define SoINTERNAL
Definition: SbBasic.h:155
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
Definition: SbSystem.h:81
#define SO_NODE_HEADER(className)
Non-abstract classes have everything abstract classes have, plus a way to create an instance.
Definition: SoSubNode.h:170
int getLength() const
Returns number of pointers in list.
Definition: SbPList.h:110
Abstract base class for all actions.
Definition: SoAction.h:179
Performs a generic traversal of the scene graph.
This class maintains a list of child nodes for any node.
Definition: SoChildList.h:83
Directional light node with 3D interface for editing direction.
virtual ~SoDirectionalLightManip()
virtual void search(SoSearchAction *action)
virtual void getMatrix(SoGetMatrixAction *action)
SoDirectionalLightManip()
Constructor.
bool replaceNode(SoPath *p)
Replaces the tail of the path with this manipulator.
virtual void getBoundingBox(SoGetBoundingBoxAction *action)
virtual void doAction(SoAction *action)
These functions implement all actions for nodekits.
bool replaceManip(SoPath *p, SoDirectionalLight *newOne) const
Replaces the tail of the path, which must be this manipulator, with the given SoDirectionalLight node...
static void initClass()
initialize the class
virtual void pick(SoPickAction *action)
static void fieldSensorCB(void *, SoSensor *)
virtual void GLRender(SoGLRenderAction *action)
Creates a light source during rendering.
void setDragger(SoDragger *newDragger)
virtual SoChildList * getChildren() const
Returns pointer to children, or NULL if none.
virtual void handleEvent(SoHandleEventAction *action)
static void valueChangedCB(void *, SoDragger *)
static void transferFieldValues(const SoDirectionalLight *from, SoDirectionalLight *to)
SoDragger * getDragger()
Returns a pointer to the dragger being used by this manipulator.
virtual void callback(SoCallbackAction *action)
virtual void copyContents(const SoFieldContainer *fromFC, bool copyConnections)
Redefines this to also copy the dragger.
Node representing a directional light source.
Base class for nodekits that move in response to click-drag-release mouse events.
Definition: SoDragger.h:225
Abstract base class for objects that contain fields.
Sensor class that can be attached to Inventor fields.
Definition: SoFieldSensor.h:80
Renders a scene graph using OpenGL.
Computes bounding box of a scene.
Computes transformation matrix for subgraph.
Allows nodes in a graph to receive input events.
Path that points to a list of hierarchical nodes.
Definition: SoPath.h:109
Abstract base class for picking objects in a scene.
Definition: SoPickAction.h:77
Searches for nodes in a scene graph.
Abstract base class for Inventor sensors.
Definition: SoSensor.h:108