libsurf
Programmer's Documentation

iges314.h (r6227/r5850)
1 /* Copyright (C) 2015 David Eller <david@larosterna.com>
2  *
3  * This program is free software; you can redistribute it and/or modify it under
4  * the terms of the GNU General Public License as published by the Free Software
5  * Foundation; either version 2 of the License, or (at your option) any later
6  * version. This program is distributed in the hope that it will be useful, but
7  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
9  * details. You should have received a copy of the GNU General Public License
10  * along with this program; if not, write to the Free Software Foundation,
11  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
12  */
13 
14 #ifndef SURF_IGES314_H
15 #define SURF_IGES314_H
16 
17 #include "igesentity.h"
18 #include <genua/color.h>
19 #include <string>
20 
29 {
30 public:
31 
34 
36  explicit IgesColorDefinition(const Color &c) : IgesEntity(314), m_rgb(c) {}
37 
39  void setRGB(float r, float g, float b) {
40  m_rgb.assign(r, g, b);
41  }
42 
44  const Color & color() const {return m_rgb;}
45 
47  void color(const Color & c) {m_rgb = c;}
48 
50  void definition(IgesFile & file);
51 
53  uint parse(const std::string & pds, const Indices & vpos);
54 
55 private:
56 
59 
61  std::string m_cname;
62 };
63 
64 #endif
IgesColorDefinition(const Color &c)
create from color
Definition: iges314.h:36
Base class for entities in IGES files.
Definition: igesentity.h:32
void color(const Color &c)
access color object
Definition: iges314.h:47
Main interface to IGES files.
Definition: igesfile.h:32
void setRGB(float r, float g, float b)
set color components
Definition: iges314.h:39
uint parse(const std::string &pds, const Indices &vpos)
extract from file
Definition: iges314.cpp:32
std::string m_cname
optional color name
Definition: iges314.h:61
void definition(IgesFile &file)
assemble definition
Definition: iges314.cpp:18
IGES Entity 314: Color definition.
Definition: iges314.h:28
void assign(uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
IgesColorDefinition()
create empty entry
Definition: iges314.h:33
const Color & color() const
access color object
Definition: iges314.h:44
Color m_rgb
color components
Definition: iges314.h:58
Generated on Wed Jan 19 2022 03:03:15 for libsurf by   doxygen 1.8.5