root/cafu/trunk/CaWE/MapPlant.hpp

Revision 457, 3.2 KB (checked in by Carsten, 4 months ago)

Using UltraEdit's multi-line search-and-replace-in-files feature, replaced


^#ifndef _(CAFU|CF|CFS|CA)_(.*)_$
^#define _\1_\2_$

with

#ifndef CAFU_\2_INCLUDED
#define CAFU_\2_INCLUDED

and


^#ifndef _(.*)_HPP_$
^#define _\1_HPP_$

with

#ifndef CAFU_\1_HPP_INCLUDED
#define CAFU_\1_HPP_INCLUDED

Closes #91.

Line 
1/*
2=================================================================================
3This file is part of Cafu, the open-source game engine and graphics engine
4for multiplayer, cross-platform, real-time 3D action.
5Copyright (C) 2002-2012 Carsten Fuchs Software.
6
7Cafu is free software: you can redistribute it and/or modify it under the terms
8of the GNU General Public License as published by the Free Software Foundation,
9either version 3 of the License, or (at your option) any later version.
10
11Cafu is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13PURPOSE. See the GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with Cafu. If not, see <http://www.gnu.org/licenses/>.
17
18For support and more information about Cafu, visit us at <http://www.cafu.de>.
19=================================================================================
20*/
21
22#ifndef CAFU_MAP_PLANT_HPP_INCLUDED
23#define CAFU_MAP_PLANT_HPP_INCLUDED
24
25#include "MapPrimitive.hpp"
26#include "Plants/Tree.hpp"
27
28
29class  MapDocumentT;
30struct PlantDescriptionT;
31class  PlantDescrManT;
32
33
34class MapPlantT : public MapPrimitiveT
35{
36    public:
37
38    MapPlantT();
39    MapPlantT(const PlantDescriptionT* PlantDescription, unsigned long RandomSeed, const Vector3fT& Position);
40
41    /// The copy constructor for copying a plant.
42    /// @param Plant   The plant to copy-construct this plant from.
43    MapPlantT(const MapPlantT& Plant);
44
45
46    // Implementations and overrides for base class methods.
47    MapPlantT* Clone() const;
48    void       Assign(const MapElementT* Elem);
49
50
51    // MapElementT implementation.
52    BoundingBox3fT GetBB() const;
53
54    void Render2D(Renderer2DT& Renderer) const;
55    void Render3D(Renderer3DT& Renderer) const;
56
57    bool TracePixel(const wxPoint& Pixel, int Radius, const ViewWindow2DT& ViewWin) const;
58    wxString GetDescription() const { return "Plant"; }
59    bool IsTranslucent() const { return true; }
60
61    // Implement the MapElementT transformation methods.
62    void TrafoMove(const Vector3fT& Delta);
63    void TrafoRotate(const Vector3fT& RefPoint, const cf::math::AnglesfT& Angles);
64    void TrafoScale(const Vector3fT& RefPoint, const Vector3fT& Scale);
65    void TrafoMirror(unsigned int NormalAxis, float Dist);
66    void Transform(const MatrixT& Matrix);
67
68    void Load_cmap(TextParserT& TP, MapDocumentT& MapDoc);
69    void Save_cmap(std::ostream& OutFile, unsigned long PlantNr, const MapDocumentT& MapDoc) const;
70
71    // The TypeSys related declarations for this class.
72    virtual const cf::TypeSys::TypeInfoT* GetType() const { return &TypeInfo; }
73    static void* CreateInstance(const cf::TypeSys::CreateParamsT& Params);
74    static const cf::TypeSys::TypeInfoT TypeInfo;
75
76
77    private:
78
79    friend class InspDlgPrimitivePropsT;
80    friend class CommandChangePlantSeedT;
81    friend class CommandChangePlantDescrT;
82
83    TreeT              m_Tree;
84    unsigned long      m_RandomSeed;
85    cf::math::AnglesfT m_Angles;
86    Vector3fT          m_Position;
87    wxString           m_DescrFileName;
88};
89
90#endif
Note: See TracBrowser for help on using the browser.