Updating the changelog in the VERSION file, and version_sync.
[shapes.git] / source / tagtypes.h
blob26c9c6769c6bb3da6373d50865a439a171988fde
1 /* This file is part of Shapes.
3 * Shapes is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * any later version.
8 * Shapes is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright 2008 Henrik Tidefelt
19 #pragma once
21 #include "drawabletypes.h"
22 #include "elementarytypes.h"
24 namespace Shapes
26 namespace Lang
29 class Tagged2D : public Lang::Drawable2D
31 protected:
32 Lang::Symbol::KeyType key_;
33 public:
34 Tagged2D( const RefCountPtr< const Lang::Symbol > & key );
35 Tagged2D( const Lang::Symbol::KeyType key );
36 virtual ~Tagged2D( );
37 Lang::Symbol::KeyType key( ) const;
40 class TaggedValue2D : public Lang::Tagged2D
42 RefCountPtr< const Lang::Value > val_;
43 public:
44 TaggedValue2D( const RefCountPtr< const Lang::Symbol > & key, const RefCountPtr< const Lang::Value > & val );
45 TaggedValue2D( const Lang::Symbol::KeyType key, const RefCountPtr< const Lang::Value > & val );
46 virtual ~TaggedValue2D( );
47 virtual void shipout( std::ostream & os, Kernel::PageContentStates * pdfState, const Lang::Transform2D & tf ) const;
48 virtual RefCountPtr< const Lang::ElementaryPath2D > bbox( Lang::Drawable2D::BoxType boxType ) const;
49 virtual RefCountPtr< const Lang::Geometric3D > to3D( const RefCountPtr< const Lang::Geometric2D > & self ) const;
50 virtual void findTags( std::vector< Kernel::ValueRef > * dst, const Kernel::PassedDyn & dyn, Lang::Symbol::KeyType key, const Lang::Transform2D & tf ) const;
51 virtual bool findOneTag( Kernel::EvalState * evalState, Lang::Symbol::KeyType key, const Lang::Transform2D & tf ) const;
52 virtual void show( std::ostream & os ) const;
53 RefCountPtr< const Lang::Value > val( ) const;
54 virtual void gcMark( Kernel::GCMarkedSet & marked );
57 class TaggedGeometric2D : public Lang::Tagged2D
59 RefCountPtr< const Lang::Geometric2D > val_;
60 public:
61 TaggedGeometric2D( const RefCountPtr< const Lang::Symbol > & key, const RefCountPtr< const Lang::Geometric2D > & val );
62 TaggedGeometric2D( const Lang::Symbol::KeyType key, const RefCountPtr< const Lang::Geometric2D > & val );
63 virtual ~TaggedGeometric2D( );
64 virtual void shipout( std::ostream & os, Kernel::PageContentStates * pdfState, const Lang::Transform2D & tf ) const;
65 virtual RefCountPtr< const Lang::ElementaryPath2D > bbox( Lang::Drawable2D::BoxType boxType ) const;
66 virtual RefCountPtr< const Lang::Geometric3D > to3D( const RefCountPtr< const Lang::Geometric2D > & self ) const;
67 virtual void findTags( std::vector< Kernel::ValueRef > * dst, const Kernel::PassedDyn & dyn, Lang::Symbol::KeyType key, const Lang::Transform2D & tf ) const;
68 virtual bool findOneTag( Kernel::EvalState * evalState, Lang::Symbol::KeyType key, const Lang::Transform2D & tf ) const;
69 virtual void show( std::ostream & os ) const;
70 virtual void gcMark( Kernel::GCMarkedSet & marked );
73 class TaggedDrawable2D : public Lang::Tagged2D
75 RefCountPtr< const Lang::Drawable2D > val_;
76 public:
77 TaggedDrawable2D( const RefCountPtr< const Lang::Symbol > & key, const RefCountPtr< const Lang::Drawable2D > & val );
78 TaggedDrawable2D( const Lang::Symbol::KeyType key, const RefCountPtr< const Lang::Drawable2D > & val );
79 virtual ~TaggedDrawable2D( );
80 virtual void shipout( std::ostream & os, Kernel::PageContentStates * pdfState, const Lang::Transform2D & tf ) const;
81 virtual RefCountPtr< const Lang::ElementaryPath2D > bbox( Lang::Drawable2D::BoxType boxType ) const;
82 virtual RefCountPtr< const Lang::Geometric3D > to3D( const RefCountPtr< const Lang::Geometric2D > & self ) const;
83 virtual void findTags( std::vector< Kernel::ValueRef > * dst, const Kernel::PassedDyn & dyn, Lang::Symbol::KeyType key, const Lang::Transform2D & tf ) const;
84 virtual bool findOneTag( Kernel::EvalState * evalState, Lang::Symbol::KeyType key, const Lang::Transform2D & tf ) const;
85 virtual void show( std::ostream & os ) const;
86 virtual void gcMark( Kernel::GCMarkedSet & marked );
89 class Tagged3D : public Lang::Drawable3D
91 protected:
92 Lang::Symbol::KeyType key_;
93 public:
94 Tagged3D( const RefCountPtr< const Lang::Symbol > & key );
95 Tagged3D( const Lang::Symbol::KeyType key );
96 virtual ~Tagged3D( );
97 Lang::Symbol::KeyType key( ) const;
100 class TaggedValue3D : public Lang::Tagged3D
102 RefCountPtr< const Lang::Value > val_;
103 public:
104 TaggedValue3D( const RefCountPtr< const Lang::Symbol > & key, const RefCountPtr< const Lang::Value > & val );
105 TaggedValue3D( const Lang::Symbol::KeyType key, const RefCountPtr< const Lang::Value > & val );
106 virtual ~TaggedValue3D( );
107 virtual RefCountPtr< const Lang::Drawable2D > typed_to2D( const Kernel::PassedDyn & dyn, const Lang::Transform3D & tf, const RefCountPtr< const Lang::Drawable3D > & self ) const;
108 virtual void polygonize( std::list< RefCountPtr< Computation::PaintedPolygon3D > > * zBufPile, std::list< RefCountPtr< Computation::StrokedLine3D > > * linePile, const Kernel::PassedDyn & dyn, const Lang::Transform3D & tf, const RefCountPtr< const Lang::Drawable3D > & self ) const;
109 virtual void findTags( std::vector< Kernel::ValueRef > * dst, const Kernel::PassedDyn & dyn, Lang::Symbol::KeyType key, const Lang::Transform3D & tf ) const;
110 virtual bool findOneTag( Kernel::EvalState * evalState, Lang::Symbol::KeyType key, const Lang::Transform3D & tf ) const;
111 virtual void show( std::ostream & os ) const;
112 virtual void gcMark( Kernel::GCMarkedSet & marked );
115 class TaggedGeometric3D : public Lang::Tagged3D
117 RefCountPtr< const Lang::Geometric3D > val_;
118 public:
119 TaggedGeometric3D( const RefCountPtr< const Lang::Symbol > & key, const RefCountPtr< const Lang::Geometric3D > & val );
120 TaggedGeometric3D( const Lang::Symbol::KeyType key, const RefCountPtr< const Lang::Geometric3D > & val );
121 virtual ~TaggedGeometric3D( );
122 virtual RefCountPtr< const Lang::Drawable2D > typed_to2D( const Kernel::PassedDyn & dyn, const Lang::Transform3D & tf, const RefCountPtr< const Lang::Drawable3D > & self ) const;
123 virtual void polygonize( std::list< RefCountPtr< Computation::PaintedPolygon3D > > * zBufPile, std::list< RefCountPtr< Computation::StrokedLine3D > > * linePile, const Kernel::PassedDyn & dyn, const Lang::Transform3D & tf, const RefCountPtr< const Lang::Drawable3D > & self ) const;
124 virtual void findTags( std::vector< Kernel::ValueRef > * dst, const Kernel::PassedDyn & dyn, Lang::Symbol::KeyType key, const Lang::Transform3D & tf ) const;
125 virtual bool findOneTag( Kernel::EvalState * evalState, Lang::Symbol::KeyType key, const Lang::Transform3D & tf ) const;
126 virtual void show( std::ostream & os ) const;
127 virtual void gcMark( Kernel::GCMarkedSet & marked );
130 class TaggedDrawable3D : public Lang::Tagged3D
132 RefCountPtr< const Lang::Drawable3D > val_;
133 public:
134 TaggedDrawable3D( const RefCountPtr< const Lang::Symbol > & key, const RefCountPtr< const Lang::Drawable3D > & val );
135 TaggedDrawable3D( const Lang::Symbol::KeyType key, const RefCountPtr< const Lang::Drawable3D > & val );
136 virtual ~TaggedDrawable3D( );
137 virtual RefCountPtr< const Lang::Drawable2D > typed_to2D( const Kernel::PassedDyn & dyn, const Lang::Transform3D & tf, const RefCountPtr< const Lang::Drawable3D > & self ) const;
138 virtual void polygonize( std::list< RefCountPtr< Computation::PaintedPolygon3D > > * zBufPile, std::list< RefCountPtr< Computation::StrokedLine3D > > * linePile, const Kernel::PassedDyn & dyn, const Lang::Transform3D & tf, const RefCountPtr< const Lang::Drawable3D > & self ) const;
139 virtual void findTags( std::vector< Kernel::ValueRef > * dst, const Kernel::PassedDyn & dyn, Lang::Symbol::KeyType key, const Lang::Transform3D & tf ) const;
140 virtual bool findOneTag( Kernel::EvalState * evalState, Lang::Symbol::KeyType key, const Lang::Transform3D & tf ) const;
141 virtual void show( std::ostream & os ) const;
142 virtual void gcMark( Kernel::GCMarkedSet & marked );