VR-Forces 4.6.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
geometry
color.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 1999 MAK Technologies, Inc.
3
** All rights reserved.
4
*********************************************************************/
5
/*********************************************************************
6
** $RCSfile: gdbColor.h,v $ $Revision: 1.9 $ $State: Exp $
7
*********************************************************************/
8
#ifndef color_H_
9
#define color_H_
10
11
// \file gdbColor.h
12
// \brief Contains the DtColor class declaration.
13
14
#include "
geometry/geometryDefines.h
"
15
#include <stdio.h>
16
#include <iostream>
17
#include <vlutil/vlString.h>
18
#include <vlutil/vlMachineTypes.h>
19
#include <vlutil/vlUtil.h>
20
21
22
//
23
// DtColor represents a color assigned to a polygon, or
24
// pixel element.
25
class
DT_DLL_geometry
DtColor
26
{
27
public
:
28
// default constructor
29
DtColor
();
30
31
// additional constructor
32
DtColor
(DtU8 red, DtU8 green, DtU8 blue, DtU8 alpha);
33
34
// destructor
35
virtual
~
DtColor
();
36
37
// copy constructor
38
DtColor
(
const
DtColor
& orig);
39
40
// assignment operator
41
DtColor
& operator=(
const
DtColor
& orig);
42
43
// set specified colors -- mutator function
44
virtual
void
setColors(DtU8 red, DtU8 green, DtU8 blue, DtU8 alpha);
45
46
// accessor functions
47
virtual
DtU8 red()
const
;
48
virtual
DtU8 green()
const
;
49
virtual
DtU8 blue()
const
;
50
virtual
DtU8 alpha()
const
;
51
52
// comparison function
53
virtual
int
operator==
(
const
DtColor
& other)
const
;
54
55
// help function for debugging
56
virtual
void
dump()
const
;
57
58
// input/output functions
59
virtual
bool
readFrom(FILE* fp);
60
virtual
bool
writeTo(FILE* fp);
61
62
#ifndef NO_VRLINK
63
virtual
DtString
string()
const
;
64
#endif
65
66
protected
:
67
68
DtU8
myRed
;
69
DtU8
myGreen
;
70
DtU8
myBlue
;
71
DtU8
myAlpha
;
72
73
};
74
75
inline
DtU8
DtColor::red
()
const
76
{
77
return
myRed
;
78
}
79
80
inline
DtU8
DtColor::green
()
const
81
{
82
return
myGreen
;
83
}
84
85
inline
DtU8
DtColor::blue
()
const
86
{
87
return
myBlue
;
88
}
89
90
inline
DtU8
DtColor::alpha
()
const
91
{
92
return
myAlpha
;
93
}
94
95
DT_DLL_geometry
std::ostream&
operator<<
(std::ostream& os,
const
DtColor
& color);
96
DT_DLL_geometry
std::istream&
operator>>
(std::istream& is,
DtColor
& color);
97
98
#endif
Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)