00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_GFX_CARTOON_RENDERER_HH
00020 #define OST_GFX_CARTOON_RENDERER_HH
00021
00022 #include <ost/geom/geom.hh>
00023
00024 #include <ost/gfx/entity_fw.hh>
00025
00026 #include <ost/gfx/impl/trace_renderer_base.hh>
00027 #include <ost/gfx/impl/entity_detail.hh>
00028 #include <ost/gfx/render_options/cartoon_render_options.hh>
00029 #include <ost/gfx/impl/backbone_trace.hh>
00030
00031 namespace ost { namespace gfx { namespace impl {
00032
00035 class DLLEXPORT_OST_GFX CartoonRenderer: public TraceRendererBase {
00036 public:
00037 CartoonRenderer(BackboneTrace& trace, bool force_tube=false);
00038
00039 virtual void PrepareRendering();
00040 virtual void Render();
00041
00042 virtual bool CanSetOptions(RenderOptionsPtr& render_options);
00043 virtual void SetOptions(RenderOptionsPtr& render_options);
00044 virtual RenderOptionsPtr GetOptions();
00045
00046
00047 virtual void SetForceTube(bool force_tube);
00048
00049
00050 virtual ~CartoonRenderer();
00051
00052 private:
00053 void RebuildSplineObj(const SplineEntryList& l, IndexedVertexArray& va,
00054 SplineEntryListList& spline_list_list,
00055 const TraceSubset& subset, bool is_sel);
00056
00057 void CapProfile(const impl::TraceProfile& p,
00058 const impl::SplineEntry& se,
00059 bool flipn, IndexedVertexArray& va);
00060
00061 void AssembleProfile(const TraceProfile& prof1,
00062 const TraceProfile& prof2,
00063 IndexedVertexArray& va);
00064
00065 TraceProfile TransformAndAddProfile(const std::vector<TraceProfile>& profiles,
00066 const SplineEntry& se,
00067 IndexedVertexArray& va);
00068
00069 void PrepareRendering(TraceSubset& subset, IndexedVertexArray& va,
00070 SplineEntryListList& spline_list_list, bool is_sel);
00071
00072 TraceProfile GetCircProfile(unsigned int detail, float rx, float ry, unsigned int type, float ecc);
00073
00074 bool force_tube_;
00075 CartoonRenderOptionsPtr options_;
00076 SplineEntryListList spline_list_list_;
00077 SplineEntryListList sel_spline_list_list_;
00078 };
00079
00080 }}}
00081
00082 #endif // OST_GFX_CARTOON_RENDERER_HH