Commit d31bbb33 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Renamed ImageRepresentationDisk::getImage() to...

Renamed ImageRepresentationDisk::getImage() to ImageRepresentationDisk::getWeaklyTypedPointer() for more consistency with the other representations.
Added a UML component diagram of the main CAMPVis concepts as well as a UML class diagram of the ImageData API.
parent 7e5146ce
...@@ -34,7 +34,7 @@ namespace campvis { ...@@ -34,7 +34,7 @@ namespace campvis {
// test source image type via dynamic cast // test source image type via dynamic cast
if (const ImageRepresentationDisk* tester = dynamic_cast<const ImageRepresentationDisk*>(source)) { if (const ImageRepresentationDisk* tester = dynamic_cast<const ImageRepresentationDisk*>(source)) {
WeaklyTypedPointer wtp = tester->getImageData(); WeaklyTypedPointer wtp = tester->getWeaklyTypedPointer();
if (wtp._pointer == nullptr) { if (wtp._pointer == nullptr) {
LERRORC("CAMPVis.core.datastructures.GlConversion", "Could not load image from disk during conversion."); LERRORC("CAMPVis.core.datastructures.GlConversion", "Could not load image from disk during conversion.");
...@@ -89,7 +89,7 @@ namespace campvis { ...@@ -89,7 +89,7 @@ namespace campvis {
// test source image type via dynamic cast // test source image type via dynamic cast
if (const ImageRepresentationDisk* tester = dynamic_cast<const ImageRepresentationDisk*>(source)) { if (const ImageRepresentationDisk* tester = dynamic_cast<const ImageRepresentationDisk*>(source)) {
return ImageRepresentationLocal::create(tester->getParent(), tester->getImageData()); return ImageRepresentationLocal::create(tester->getParent(), tester->getWeaklyTypedPointer());
} }
else if (const ImageRepresentationGL* tester = dynamic_cast<const ImageRepresentationGL*>(source)) { else if (const ImageRepresentationGL* tester = dynamic_cast<const ImageRepresentationGL*>(source)) {
cgt::OpenGLJobProcessor::ScopedSynchronousGlJobExecution jobGuard; cgt::OpenGLJobProcessor::ScopedSynchronousGlJobExecution jobGuard;
......
...@@ -86,7 +86,7 @@ namespace campvis { ...@@ -86,7 +86,7 @@ namespace campvis {
if (const ImageRepresentationDisk* tester = dynamic_cast<const ImageRepresentationDisk*>(source)) { if (const ImageRepresentationDisk* tester = dynamic_cast<const ImageRepresentationDisk*>(source)) {
// converting from disk representation // converting from disk representation
if (tester->getBaseType() == TypeTraits<BASETYPE, NUMCHANNELS>::weaklyTypedPointerBaseType && tester->getParent()->getNumChannels() == NUMCHANNELS) { if (tester->getBaseType() == TypeTraits<BASETYPE, NUMCHANNELS>::weaklyTypedPointerBaseType && tester->getParent()->getNumChannels() == NUMCHANNELS) {
WeaklyTypedPointer wtp = tester->getImageData(); WeaklyTypedPointer wtp = tester->getWeaklyTypedPointer();
return GenericImageRepresentationLocal<BASETYPE, NUMCHANNELS>::create(tester->getParent(), static_cast<ElementType*>(wtp._pointer)); return GenericImageRepresentationLocal<BASETYPE, NUMCHANNELS>::create(tester->getParent(), static_cast<ElementType*>(wtp._pointer));
} }
else { else {
......
...@@ -50,7 +50,7 @@ namespace campvis { ...@@ -50,7 +50,7 @@ namespace campvis {
ImageRepresentationDisk::~ImageRepresentationDisk() { ImageRepresentationDisk::~ImageRepresentationDisk() {
} }
campvis::WeaklyTypedPointer ImageRepresentationDisk::getImageData() const { campvis::WeaklyTypedPointer ImageRepresentationDisk::getWeaklyTypedPointer() const {
const cgt::svec3& size = getSize(); const cgt::svec3& size = getSize();
size_t numElements = cgt::hmul(size); size_t numElements = cgt::hmul(size);
size_t numBytesPerElement = WeaklyTypedPointer::numBytes(_type, _parent->getNumChannels()); size_t numBytesPerElement = WeaklyTypedPointer::numBytes(_type, _parent->getNumChannels());
......
...@@ -91,7 +91,7 @@ namespace campvis { ...@@ -91,7 +91,7 @@ namespace campvis {
* \note The caller has to take ownership of the returned pointer. * \note The caller has to take ownership of the returned pointer.
* \return Pointer to the image data in the local memory, to be owned by caller. * \return Pointer to the image data in the local memory, to be owned by caller.
*/ */
WeaklyTypedPointer getImageData() const; WeaklyTypedPointer getWeaklyTypedPointer() const;
/** /**
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="13.3">
<help_text>// Uncomment the following line to change the fontsize and font:
fontsize=14
fontfamily=SansSerif //possible: SansSerif,Serif,Monospaced
//////////////////////////////////////////////////////////////////////////////////////////////
// Welcome to UMLet!
//
// Double-click on elements to add them to the diagram, or to copy them
// Edit elements by modifying the text in this panel
// Hold Ctrl to select multiple elements
// Use Ctrl+mouse to select via lasso
//
// Use +/- or Ctrl+mouse wheel to zoom
// Drag a whole relation at its central square icon
//
// Press Ctrl+C to copy the whole diagram to the system clipboard (then just paste it to, eg, Word)
// Edit the files in the "palettes" directory to create your own element palettes
//
// Select "Custom Elements &gt; New..." to create new element types
//////////////////////////////////////////////////////////////////////////////////////////////
// This text will be stored with each diagram; use it for notes.</help_text>
<zoom_level>10</zoom_level>
<element>
<id>UMLGeneric</id>
<coordinates>
<x>580</x>
<y>650</y>
<w>200</w>
<h>60</h>
</coordinates>
<panel_attributes>symbol=component
bg=white
transparency=25
*Processor*</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>660</x>
<y>550</y>
<w>50</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=[v]-(
</panel_attributes>
<additional_attributes>20.0;10.0;20.0;40.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>670</x>
<y>600</y>
<w>110</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=()-[v]
r2=Algorithms
r2pos=20,-2
</panel_attributes>
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
</element>
<element>
<id>UMLGeneric</id>
<coordinates>
<x>240</x>
<y>580</y>
<w>200</w>
<h>60</h>
</coordinates>
<panel_attributes>symbol=component
bg=white
transparency=25
*DataContainer*</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLGeneric</id>
<coordinates>
<x>580</x>
<y>500</y>
<w>200</w>
<h>60</h>
</coordinates>
<panel_attributes>symbol=component
bg=white
transparency=25
*Pipeline*
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>430</x>
<y>600</y>
<w>190</w>
<h>30</h>
</coordinates>
<panel_attributes>lt=()-[=]
r1=Data Storage
r1pos=128,10</panel_attributes>
<additional_attributes>70.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>480</x>
<y>520</y>
<w>120</w>
<h>100</h>
</coordinates>
<panel_attributes>lt=[=]-(</panel_attributes>
<additional_attributes>100.0;10.0;20.0;10.0;20.0;70.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>480</x>
<y>610</y>
<w>120</w>
<h>90</h>
</coordinates>
<panel_attributes>lt=[=]-(
</panel_attributes>
<additional_attributes>100.0;70.0;20.0;70.0;20.0;20.0</additional_attributes>
</element>
<element>
<id>UMLGeneric</id>
<coordinates>
<x>920</x>
<y>650</y>
<w>200</w>
<h>60</h>
</coordinates>
<panel_attributes>symbol=component
bg=white
transparency=25
*Property*</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>810</x>
<y>660</y>
<w>130</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=()-[&lt;]
r1=Configuration
r1pos=-60,40
</panel_attributes>
<additional_attributes>50.0;20.0;110.0;20.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>770</x>
<y>660</y>
<w>100</w>
<h>50</h>
</coordinates>
<panel_attributes>lt=[&lt;]-(
</panel_attributes>
<additional_attributes>10.0;20.0;70.0;20.0</additional_attributes>
</element>
<element>
<id>UMLGeneric</id>
<coordinates>
<x>920</x>
<y>250</y>
<w>200</w>
<h>60</h>
</coordinates>
<panel_attributes>symbol=component
bg=white
transparency=25
*PropertyWidget*</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLGeneric</id>
<coordinates>
<x>580</x>
<y>250</y>
<w>200</w>
<h>60</h>
</coordinates>
<panel_attributes>symbol=component
bg=white
transparency=25
*OpenGL Canvas*
/(Window)/
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>670</x>
<y>300</y>
<w>70</w>
<h>120</h>
</coordinates>
<panel_attributes>lt=[v]-()
r2=GUI
r2pos=20,37</panel_attributes>
<additional_attributes>10.0;10.0;10.0;100.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>660</x>
<y>400</y>
<w>50</w>
<h>120</h>
</coordinates>
<panel_attributes>lt=)-[v]
</panel_attributes>
<additional_attributes>20.0;20.0;20.0;100.0</additional_attributes>
</element>
<element>
<id>UMLPackage</id>
<coordinates>
<x>210</x>
<y>450</y>
<w>940</w>
<h>290</h>
</coordinates>
<panel_attributes>*CAMPVis Core*
bg=#CCCCCC
layer=-1</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>1010</x>
<y>300</y>
<w>70</w>
<h>120</h>
</coordinates>
<panel_attributes>lt=[v]-()
r2=GUI
r2pos=20,37</panel_attributes>
<additional_attributes>10.0;10.0;10.0;100.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>1000</x>
<y>400</y>
<w>50</w>
<h>270</h>
</coordinates>
<panel_attributes>lt=)-[v]
</panel_attributes>
<additional_attributes>20.0;20.0;20.0;250.0</additional_attributes>
</element>
<element>
<id>UMLPackage</id>
<coordinates>
<x>210</x>
<y>200</y>
<w>940</w>
<h>140</h>
</coordinates>
<panel_attributes>*CAMPVis Application*
bg=#CCCCCC
layer=-1</panel_attributes>
<additional_attributes/>
</element>
</diagram>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="13.3">
<zoom_level>8</zoom_level>
<element>
<id>UMLClass</id>
<coordinates>
<x>384</x>
<y>312</y>
<w>256</w>
<h>120</h>
</coordinates>
<panel_attributes>//style=autoresize
bg=#729fcf
*ImageData*
--
_dimensionality: size_t
_size: svec3
_numChannels: size_t
--
positionToIndex(svec3): size_t
indexToPosition(size_t): svec3
getWorldBounds()
getRepresentation&lt;T&gt;(performConversion: bool)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>432</x>
<y>200</y>
<w>160</w>
<h>80</h>
</coordinates>
<panel_attributes>//style=autoresize
bg=#729fcf
*/AbstractData/*
--
--
/clone()/
/getLocalMemoryFootprint()/
/getVideoMemoryFootprint()/
/getTypeAsString()/</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>424</x>
<y>536</y>
<w>176</w>
<h>48</h>
</coordinates>
<panel_attributes>//style=autoresize
bg=#e9b96e
*/AbstractImageRepresentation/*
--
--
/clone()/</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>64</x>
<y>648</y>
<w>208</w>
<h>120</h>
</coordinates>
<panel_attributes>style=autoresize
bg=#e9b96e
*ImageRepresentationDisk*
--
_url: string
_offset: size_t
_type: WeaklyTypedPointer::BaseType
_endianess
_stride: svec3
--
_create(parent, url, type, ...)_
getWeaklyTypedPointer()</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>312</x>
<y>648</y>
<w>240</w>
<h>136</h>
</coordinates>
<panel_attributes>style=autoresize
bg=#e9b96e
/*ImageRepresentationLocal*/
--
_baseType: WeaklyTypedPointer::BaseType
--
_create(parent, weaklyTypedPointer)_
/getWeaklyTypedPointer()/
/getElementNormalized(...): float/
/setElementNormalized(..., value: float)/
/getElementNormalizedLinear(...): float/
/setElementNormalizedLinear(..., value: float)/
getNormalizedIntensityRange(): Interval&lt;float&gt;</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>592</x>
<y>648</y>
<w>224</w>
<h>112</h>
</coordinates>
<panel_attributes>style=autoresize
bg=#e9b96e
*ImageRepresentationGL*
--
_texture: Texture*
--
_create(parent, texture)_
_create(parent, weaklyTypedPointer)_
bind(shader, textureUnit, ...)
getWeaklyTypedPointerCopy()
getWeaklyTypedPointerConvert(dataType)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>784</x>
<y>456</y>
<w>304</w>
<h>136</h>
</coordinates>
<panel_attributes>//style=autoresize
bg=#c17d11
transparency=40
template=RepresentationType
*ScopedRepresentation*
/RepresentationType::ScopedRepresentation/
/&lt;&lt;Proxy&gt;&gt;/
--
dh: DataHandle
data: ImageData*
representation: RepresentationType*
--
ScopedRepresentation(dataContainer, name)
operator-&gt;(): RepresentationType*</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>864</x>
<y>656</y>
<w>328</w>
<h>88</h>
</coordinates>
<panel_attributes>style=autoresize
bg=#e9b96e
template=Basetype, Numchannels, Dim
*GenericImageRepresentationItk*
--
_itkImage: ItkImageType::Pointer
--
_create(parent, itkImage: ItkImageType::Pointer)_
getWeaklyTypedPointer()</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>320</x>
<y>808</y>
<w>296</w>
<h>112</h>
</coordinates>
<panel_attributes>//style=autoresize
bg=#e9b96e
template=Basetype, Numchannels
*GenericImageRepresentationLocal*
--
_data: ElementType*
--
_create(parent, data: ElementType*)_
getElement(...): ElementType
setElement(..., value: ElementType)
getImageData(): ElementType*</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>784</x>
<y>192</y>
<w>280</w>
<h>104</h>
</coordinates>
<panel_attributes>//style=autoresize
bg=#75507b
transparency=40
template=DataType
*ScopedTypedData*
/&lt;&lt;Proxy&gt;&gt;/
--
dh: DataHandle
data: DataType*
--
ScopedRepresentation(dataContainer, name)
operator-&gt;(): DataType*</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>32</x>
<y>200</y>
<w>176</w>
<h>56</h>
</coordinates>
<panel_attributes>//style=autoresize
bg=#ad7fa8
*DataHandle*
--
--
DataHandle(data: AbstractData*)
getData(): AbstractData*</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>504</x>
<y>272</y>
<w>24</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>200</x>
<y>224</y>
<w>248</w>
<h>24</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>290.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>496</x>
<y>576</y>
<w>528</w>
<h>104</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>10.0;10.0;10.0;50.0;640.0;50.0;640.0;110.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>424</x>
<y>576</y>
<w>96</w>
<h>88</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>100.0;10.0;100.0;50.0;10.0;50.0;10.0;90.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>496</x>
<y>576</y>
<w>224</w>
<h>88</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>10.0;10.0;10.0;50.0;260.0;50.0;260.0;90.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>160</x>
<y>576</y>
<w>360</w>
<h>88</h>
</coordinates>