SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
SVGIconConstructor.h
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 
11 #ifndef smtk_view_SVGIconConstructor_h
12 #define smtk_view_SVGIconConstructor_h
13 
14 #include "smtk/CoreExports.h"
15 #include "smtk/SystemConfig.h"
16 
17 #include <string>
18 
19 namespace smtk
20 {
21 namespace resource
22 {
23 class PersistentObject;
24 }
25 namespace view
26 {
27 class SMTKCORE_EXPORT SVGIconConstructor
28 {
29 public:
30  SVGIconConstructor(const std::string& defaultColor, const std::string& secondaryColor)
31  : m_defaultColor(defaultColor)
32  , m_secondaryColor(secondaryColor)
33  {
34  }
35 
37  : m_defaultColor("green")
38  , m_secondaryColor("black")
39  {
40  }
41 
42  std::string operator()(const smtk::resource::PersistentObject&, const std::string&) const;
43 
44 protected:
45  virtual std::string svg(const smtk::resource::PersistentObject&) const = 0;
46 
47  std::string m_defaultColor;
48  std::string m_secondaryColor;
49 };
50 
51 class SMTKCORE_EXPORT DefaultIconConstructor
52 {
53 public:
54  std::string operator()(const smtk::resource::PersistentObject&, const std::string&) const;
55 };
56 
57 class SMTKCORE_EXPORT ResourceIconConstructor : public SVGIconConstructor
58 {
59  std::string svg(const smtk::resource::PersistentObject&) const override;
60 };
61 
62 class SMTKCORE_EXPORT AttributeIconConstructor : public SVGIconConstructor
63 {
64  std::string svg(const smtk::resource::PersistentObject&) const override;
65 };
66 
67 class SMTKCORE_EXPORT MeshIconConstructor : public SVGIconConstructor
68 {
69  std::string svg(const smtk::resource::PersistentObject&) const override;
70 };
71 
72 class SMTKCORE_EXPORT ModelIconConstructor : public SVGIconConstructor
73 {
74  std::string svg(const smtk::resource::PersistentObject&) const override;
75 };
76 } // namespace view
77 } // namespace smtk
78 
79 #endif
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
smtk::view::MeshIconConstructor
Definition: SVGIconConstructor.h:67
smtk::view::DefaultIconConstructor
Definition: SVGIconConstructor.h:51
smtk::view::AttributeIconConstructor
Definition: SVGIconConstructor.h:62
smtk::view::ResourceIconConstructor
Definition: SVGIconConstructor.h:57
smtk::view::ModelIconConstructor
Definition: SVGIconConstructor.h:72
smtk::view::SVGIconConstructor
Definition: SVGIconConstructor.h:27
smtk::resource::PersistentObject
An abstract base class for SMTK resources and their components.
Definition: PersistentObject.h:39