gwnavruntime/visualsystem/shapecolor.h Source File

shapecolor.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 #pragma once
8 
10 
11 namespace Kaim
12 {
13 
16 {
17 public:
18  static const KyUInt32 Invisible = Color::Invisible;
19  static Color GetInvisible() { return Color::Invisible; }
20 
21  static ShapeColor FillOnly(const ShapeColor& shapeColor) { return ShapeColor(shapeColor.GetFillColor(), Invisible); }
22 
23  static ShapeColor FillOnly(Color fillColor) { return ShapeColor(fillColor , Invisible); }
24  static ShapeColor FillOnly(Color fillColor, KyUInt8 fillAlpha) { return ShapeColor(fillColor, fillAlpha , Invisible); }
25 
26  static ShapeColor FillOnly(KyUInt32 fillColor) { return ShapeColor(fillColor , Invisible); }
27  static ShapeColor FillOnly(KyUInt32 fillColor, KyUInt8 fillAlpha) { return ShapeColor(fillColor, fillAlpha , Invisible); }
28 
29  static ShapeColor LineOnly(Color lineColor) { return ShapeColor(GetInvisible(), lineColor); }
30 
31  static ShapeColor FillAndLine(Color fillColor) { return ShapeColor(fillColor , Color::Black); }
32  static ShapeColor FillAndLine(Color fillColor, KyUInt8 fillAlpha) { return ShapeColor(fillColor, fillAlpha, Color::Black); }
33  static ShapeColor FillAndLine(Color fillColor, KyUInt8 fillAlpha, Color lineColor) { return ShapeColor(fillColor, fillAlpha, lineColor); }
34  static ShapeColor FillAndLine(Color fillColor, Color lineColor) { return ShapeColor(fillColor, lineColor); }
35 
36  ShapeColor() : m_fillColor(GetInvisible()), m_lineColor(GetInvisible()) {}
37 
38  ShapeColor(Color color) : m_fillColor(Invisible), m_lineColor(color) {} // by default we use only lines
39  ShapeColor(KyUInt32 color) : m_fillColor(Invisible), m_lineColor(color) {} // by default we use only lines
40 
41  ShapeColor(Color fillColor, Color lineColor) : m_fillColor(fillColor), m_lineColor(lineColor) {}
42  ShapeColor(KyUInt32 fillColor, KyUInt32 lineColor) : m_fillColor(fillColor), m_lineColor(lineColor) {}
43 
44  ShapeColor(Color fillColor, KyUInt8 fillAlpha, Color lineColor) : m_fillColor(fillColor, fillAlpha), m_lineColor(lineColor) {}
45  ShapeColor(KyUInt32 fillColor, KyUInt8 fillAlpha, KyUInt32 lineColor) : m_fillColor(fillColor, fillAlpha), m_lineColor(lineColor) {}
46 
47 public:
48  Color GetLineColor() const { return m_lineColor; }
49  Color GetFillColor() const { return m_fillColor; }
50 
51 public:
52  Color m_fillColor; // color for triangles, assign GetInvisible() is you don't want triangles
53  Color m_lineColor; // color for lines, assign GetInvisible() is you don't want lines
54 };
55 inline void SwapEndianness(Endianness::Target e, ShapeColor& self)
56 {
57  SwapEndianness(e, self.m_fillColor);
58  SwapEndianness(e, self.m_lineColor);
59 }
60 
61 typedef ShapeColor VisualShapeColor; // VisualShapeColor is the deprecated class name
62 // using VisualShapeColor = ShapeColor; // when we drop vc11
63 
64 }
65 
66 
Fill and line colors used in visual debug to display shapes.
Definition: shapecolor.h:15
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:27
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
RGBA color.
Definition: color.h:16
std::uint8_t KyUInt8
uint8_t
Definition: types.h:27