1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef R2_DISPLAYER_VISUAL_ACTIVITY_SEQUENCE_H
18 #define R2_DISPLAYER_VISUAL_ACTIVITY_SEQUENCE_H
20 #include "displayer_visual.h"
23 #include "nel/misc/line.h"
25 #include "../interface_v3/group_map.h"
36 class CDisplayerVisualActivitySequence
: public CDisplayerVisual
, public CEditor::IInstanceObserver
,
37 public CGroupMap::IDeco
40 NLMISC_DECLARE_CLASS(R2::CDisplayerVisualActivitySequence
);
41 CDisplayerVisualActivitySequence();
42 ~CDisplayerVisualActivitySequence();
43 // from CDisplayerVisual
44 virtual bool isSelectable() const { return false; }
45 virtual void onAttrModified(const std::string
&attrName
, sint32 attrIndex
);
46 virtual void onPostRender();
47 virtual void onPreRender();
48 virtual void updateWorldPos();
49 virtual void setActive(bool active
);
50 virtual bool getActive() const;
52 bool _AddedToWorldMap
;
55 std::vector
<CDecal::TSmartPtr
> _Decals
;
56 std::vector
<CCtrlQuad
*> _WorldMapEdges
;
57 std::vector
<CEditor::TInstanceObserverHandle
> _ObserverHandles
;
58 // need to know when one of the component world pos is changed (no notification message reach us if
59 // word pos update is due to a parent)
60 // TODO : add a 'world pos changed' event...
63 CDisplayerVisual::TRefPtr DV
;
64 NLMISC::CVector2f WorldPos2f
;
66 std::vector
<CWorldPosCache
> _WPCache
;
67 std::vector
<NLMISC::CLine
> _FootSteps
;
68 NLMISC::CRGBA _DecalColor
;
69 // keep list of primitives traversed by this sequence
70 // allows to know when to update us if visibility of one of the primitive has changed
71 struct CTraversedPrimInfo
73 CDisplayerVisual::TRefPtr PrimDisplay
;
76 std::vector
<CTraversedPrimInfo
> _TraversedPrimInfos
;
80 void clear(bool wantRemoveFromWorldMap
= true);
81 void addFootSteps(const NLMISC::CLine
&line
);
82 void addWanderSteps(const NLMISC::CVector
&pos
);
83 void setWorldMapColor(NLMISC::CRGBA color
);
84 void setWorldMapNumEdges(uint count
);
85 CDisplayerVisual
*getParentDV() const;
86 // from CEditor::IInstanceObserver
87 virtual void onInstanceCreated(CInstance
&instance
);
88 virtual void onInstanceErased(CInstance
&instance
);
89 virtual void onAttrModified(CInstance
&instance
, const std::string
&attrName
, sint32 attrIndex
);
91 // from CGroupMap::IDeco
92 virtual void onAdd(CGroupMap
&owner
);
93 virtual void onRemove(CGroupMap
&owner
);
94 virtual void onPreRender(CGroupMap
&owner
);
95 virtual void onUpdate(CGroupMap
&owner
);
96 // return true if visible
97 // if entiyDV == groupDV, then an ungrouped entity, else the group an its entity
98 bool isVisible(CDisplayerVisual
*groupDV
, CDisplayerVisual
*entityDV
);
99 // get visual displayer of parent group, or return the entity if not grouped
100 CDisplayerVisual
*getPossibleGroupDV(CDisplayerVisual
*entityDV
);
102 void removeFromWorldMap();