Mercurial > hg > orthanc-stone
comparison Framework/Layers/DicomStructureSetRendererFactory.cpp @ 121:e66b2c757790 wasm
displaying rt-struct
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 04 Oct 2017 17:53:47 +0200 |
parents | 2eca030792aa |
children | e3433dabfb8d |
comparison
equal
deleted
inserted
replaced
120:063f7f3d9f14 | 121:e66b2c757790 |
---|---|
27 { | 27 { |
28 class DicomStructureSetRendererFactory::Renderer : public ILayerRenderer | 28 class DicomStructureSetRendererFactory::Renderer : public ILayerRenderer |
29 { | 29 { |
30 private: | 30 private: |
31 const DicomStructureSet& structureSet_; | 31 const DicomStructureSet& structureSet_; |
32 SliceGeometry slice_; | 32 CoordinateSystem3D slice_; |
33 bool visible_; | 33 bool visible_; |
34 | 34 |
35 public: | 35 public: |
36 Renderer(const DicomStructureSet& structureSet, | 36 Renderer(const DicomStructureSet& structureSet, |
37 const SliceGeometry& slice) : | 37 const CoordinateSystem3D& slice) : |
38 structureSet_(structureSet), | 38 structureSet_(structureSet), |
39 slice_(slice), | 39 slice_(slice), |
40 visible_(true) | 40 visible_(true) |
41 { | 41 { |
42 } | 42 } |
43 | 43 |
44 virtual bool RenderLayer(CairoContext& context, | 44 virtual bool RenderLayer(CairoContext& context, |
45 const ViewportGeometry& view, | 45 const ViewportGeometry& view) |
46 const SliceGeometry& viewportSlice) | |
47 { | 46 { |
48 if (visible_) | 47 if (visible_) |
49 { | 48 { |
50 cairo_set_line_width(context.GetObject(), 3.0f / view.GetZoom()); | 49 cairo_set_line_width(context.GetObject(), 3.0f / view.GetZoom()); |
51 structureSet_.Render(context, slice_); | 50 structureSet_.Render(context, slice_); |
52 } | 51 } |
53 | 52 |
54 return true; | 53 return true; |
54 } | |
55 | |
56 virtual const CoordinateSystem3D& GetLayerSlice() | |
57 { | |
58 return slice_; | |
55 } | 59 } |
56 | 60 |
57 virtual void SetLayerStyle(const RenderStyle& style) | 61 virtual void SetLayerStyle(const RenderStyle& style) |
58 { | 62 { |
59 visible_ = style.visible_; | 63 visible_ = style.visible_; |
64 return true; | 68 return true; |
65 } | 69 } |
66 }; | 70 }; |
67 | 71 |
68 | 72 |
69 ILayerRenderer* DicomStructureSetRendererFactory::CreateLayerRenderer(const SliceGeometry& displaySlice) | 73 void DicomStructureSetRendererFactory::ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice) |
70 { | 74 { |
71 bool isOpposite; | 75 bool isOpposite; |
72 if (GeometryToolbox::IsParallelOrOpposite(isOpposite, displaySlice.GetNormal(), structureSet_.GetNormal())) | 76 if (GeometryToolbox::IsParallelOrOpposite(isOpposite, viewportSlice.GetNormal(), structureSet_.GetNormal())) |
73 { | 77 { |
74 return new Renderer(structureSet_, displaySlice); | 78 NotifyLayerReady(new Renderer(structureSet_, viewportSlice), viewportSlice, false); |
75 } | |
76 else | |
77 { | |
78 return NULL; | |
79 } | 79 } |
80 } | 80 } |
81 | |
82 | |
83 ISliceableVolume& DicomStructureSetRendererFactory::GetSourceVolume() const | |
84 { | |
85 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); | |
86 } | |
87 } | 81 } |