OpenSceneGraph 3.6.5
FrontFace
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
14#ifndef OSG_FRONTFACE
15#define OSG_FRONTFACE 1
16
17#include <osg/StateAttribute>
18#include <osg/GL>
19
20namespace osg {
21
25{
26 public :
27
28 enum Mode {
29 CLOCKWISE = GL_CW,
31 };
32
34
37 StateAttribute(ff,copyop),
38 _mode(ff._mode) {}
39
41
43 virtual int compare(const StateAttribute& sa) const
44 {
45 // check the types are equal and then create the rhs variable
46 // used by the COMPARE_StateAttribute_Parameter macros below.
48
49 // compare each parameter in turn against the rhs.
51
52 return 0; // passed all the above comparison macros, must be equal.
53 }
54
55 inline void setMode(Mode mode) { _mode = mode; }
56 inline Mode getMode() const { return _mode; }
57
58 virtual void apply(State& state) const;
59
60 protected:
61
62 virtual ~FrontFace();
63
65
66};
67
68}
69
70#endif
#define COMPARE_StateAttribute_Parameter(parameter)
COMPARE_StateAttribute_Parameter macro is a helper for implementing the StatateAtribute::compare(....
Definition StateAttribute:69
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
COMPARE_StateAttribute_Types macro is a helper for implementing the StateAtribute::compare(....
Definition StateAttribute:57
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
FrontFace(const FrontFace &ff, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
Definition FrontFace:36
Mode
Definition FrontFace:28
@ COUNTER_CLOCKWISE
Definition FrontFace:30
@ CLOCKWISE
Definition FrontFace:29
Mode _mode
Definition FrontFace:64
virtual ~FrontFace()
virtual int compare(const StateAttribute &sa) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Definition FrontFace:43
virtual void apply(State &state) const
apply the OpenGL state attributes.
void setMode(Mode mode)
Definition FrontFace:55
FrontFace(Mode face=COUNTER_CLOCKWISE)
META_StateAttribute(osg, FrontFace, FRONTFACE)
Mode getMode() const
Definition FrontFace:56
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
@ FRONTFACE
Definition StateAttribute:135
#define OSG_EXPORT
Definition Export:39

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.