Atoms Crowd  7.0.0
DrawContext.h
1 #pragma once
2 // ===========================================================================
3 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
4 //
5 // Use of this software is subject to the terms of the Toolchefs license
6 // agreement provided at the time of installation or download, or which
7 // otherwise accompanies this software in either electronic or hard copy form.
8 // ===========================================================================
9 
10 #include <Atoms/Globals.h>
11 #include <AtomsCore/AtomsMath.h>
12 #include <vector>
13 
14 namespace Atoms
15 {
16  class ATOMS_EXPORT DrawContext
17  {
18  public:
19 
20  virtual ~DrawContext();
21 
22  virtual void pushAttrib(unsigned int value) = 0;
23 
24  virtual void popAttrib() = 0;
25 
26  virtual void pushClientAttrib(unsigned int value) = 0;
27 
28  virtual void popClientAttrib() = 0;
29 
30  virtual void pushMatrix() = 0;
31 
32  virtual void popMatrix() = 0;
33 
34  virtual void matrixMode(unsigned int mode) = 0;
35 
36  virtual void loadIdentity() = 0;
37 
38  virtual void multMatrix(const AtomsCore::Matrix& mtx) = 0;
39 
40  virtual void loadMatrix(const AtomsCore::Matrix& mtx) = 0;
41 
42  virtual void enable(unsigned int mode) = 0;
43 
44  virtual void disable(unsigned int mode) = 0;
45 
46  virtual bool isEnabled(unsigned int mode) = 0;
47 
48  virtual void setPointSize(double value) = 0;
49 
50  virtual void setLineSize(double value) = 0;
51 
52  virtual void setFontSize(double value) = 0;
53 
54  virtual void setLineStyle(int value, unsigned short pattern) = 0;
55 
56  virtual void setColor(const AtomsCore::Vector3 &color) = 0;
57 
58  virtual void setColor(const AtomsCore::Vector4 &color) = 0;
59 
60  virtual void points(const std::vector<AtomsCore::Vector3> &points) = 0;
61 
62  virtual void points2d(const std::vector<AtomsCore::Vector2> &points) = 0;
63 
64  virtual void lines(const std::vector<AtomsCore::Vector3> &points) = 0;
65 
66  virtual void lines2d(const std::vector<AtomsCore::Vector2> &points) = 0;
67 
68  virtual void lineStrip(const std::vector<AtomsCore::Vector3> &points) = 0;
69 
70  virtual void lineStrip(const std::vector<AtomsCore::Vector3f>& points) = 0;
71 
72  virtual void lineStrip2d(const std::vector<AtomsCore::Vector2> &points) = 0;
73 
74  virtual void lineLoop(const std::vector<AtomsCore::Vector3> &points) = 0;
75 
76  virtual void lineLoop2d(const std::vector<AtomsCore::Vector2> &points) = 0;
77 
78  virtual void triangles(const std::vector<AtomsCore::Vector3> &points) = 0;
79 
80  virtual void triangles2d(const std::vector<AtomsCore::Vector2> &points) = 0;
81 
82  virtual void setViewport(int x, int y, int w, int h) = 0;
83 
84  virtual void viewport(int& x, int& y, int& w, int& h) = 0;
85 
86  virtual void ortho2D(double l, double r, double b, double t) = 0;
87 
88  virtual void rotate(double angle, const AtomsCore::Vector3& value) = 0;
89 
90  virtual void translate(const AtomsCore::Vector3& value) = 0;
91 
92  virtual void scale(const AtomsCore::Vector3& value) = 0;
93 
94  virtual void text(const std::string& text, const AtomsCore::Vector3& pos) = 0;
95 
96  virtual void text2d(const std::string& text, const AtomsCore::Vector2& pos) = 0;
97 
98  virtual void mesh(const std::vector<AtomsCore::Vector3f>& points,
99  const std::vector<AtomsCore::Vector3f>& normals,
100  const std::vector<unsigned int>& indices) = 0;
101  };
102 }
Definition: DrawContext.h:17
AtomsMath::Vector2 Vector2
Vector2 class.
Definition: AtomsMath.h:54
AtomsMath::Vector4 Vector4
Vector4 class.
Definition: AtomsMath.h:60
AtomsMath::Vector3 Vector3
Vector3 class.
Definition: AtomsMath.h:57
AtomsMath::Matrix Matrix
Matrix class.
Definition: AtomsMath.h:63
Atoms namespace.
Definition: Agent.h:29