00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef OST_GFX_CARTOON_RENDERER_HH
00025 #define OST_GFX_CARTOON_RENDERER_HH
00026
00027 #include <ost/geom/geom.hh>
00028
00029 #include <ost/gfx/entity_fw.hh>
00030
00031 #include <ost/gfx/impl/trace_renderer_base.hh>
00032 #include <ost/gfx/impl/entity_detail.hh>
00033 #include <ost/gfx/render_options/cartoon_render_options.hh>
00034 #include <ost/gfx/impl/backbone_trace.hh>
00035
00036 namespace ost { namespace gfx { namespace impl {
00037
00040 class DLLEXPORT_OST_GFX CartoonRenderer: public TraceRendererBase {
00041 public:
00042 CartoonRenderer(BackboneTrace* trace, bool force_tube=false);
00043
00044 virtual geom::AlignedCuboid GetBoundingBox() const;
00045
00046 virtual void PrepareRendering();
00047
00048 virtual bool CanSetOptions(RenderOptionsPtr& render_options);
00049 virtual void SetOptions(RenderOptionsPtr& render_options);
00050 virtual RenderOptionsPtr GetOptions();
00051
00052 virtual void SetForceTube(bool force_tube);
00053
00054 private:
00055 void prepare_rendering(const BackboneTrace&,
00056 IndexedVertexArray&,
00057 SplineEntryListList&);
00058
00059 void fudge_spline_obj(SplineEntryListList&);
00060
00061 void rebuild_spline_obj(IndexedVertexArray&,
00062 const SplineEntryListList&,
00063 bool);
00064
00065 void cap_profile(const impl::TraceProfile&,
00066 const impl::SplineEntry&,
00067 bool,
00068 IndexedVertexArray&);
00069
00070 void assemble_profile(const TraceProfile&,
00071 const TraceProfile&,
00072 IndexedVertexArray&,
00073 size_t);
00074
00075 TraceProfile transform_and_add_profile(const std::vector<TraceProfile>&,
00076 const SplineEntry&,
00077 IndexedVertexArray&);
00078
00079 TraceProfile get_circ_profile(unsigned int detail, float rx, float ry, unsigned int type, float ecc);
00080
00081 bool force_tube_;
00082 CartoonRenderOptionsPtr options_;
00083 SplineEntryListList spline_list_list_;
00084 SplineEntryListList sel_spline_list_list_;
00085 };
00086
00087 }}}
00088
00089 #endif // OST_GFX_CARTOON_RENDERER_HH