Commit b916cb6f authored by Julien Malik's avatar Julien Malik

WRG

parent aa5cd392
......@@ -90,15 +90,16 @@ public:
// Compute the origin and the size of the visible region
IndexType indexBegin, indexEnd;
indexBegin[0] = static_cast<unsigned int> (m_Model->GetExtractRegion().GetIndex()[0] + m_MoveX);
indexBegin[1] = static_cast<unsigned int> (m_Model->GetExtractRegion().GetIndex()[1] + m_MoveY);
typedef IndexType::IndexValueType IndexValueType;
indexBegin[0] = static_cast<IndexValueType> (m_Model->GetExtractRegion().GetIndex()[0] + m_MoveX);
indexBegin[1] = static_cast<IndexValueType> (m_Model->GetExtractRegion().GetIndex()[1] + m_MoveY);
indexEnd[0] = indexBegin[0] + m_Model->GetExtractRegion().GetSize()[0];
indexEnd[1] = indexBegin[1] + m_Model->GetExtractRegion().GetSize()[1];
if (indexEnd[0] < static_cast<unsigned int> (m_Model->GetLayer(0)->GetExtent().GetSize()[0]) && indexEnd[1]
< static_cast<unsigned int> (m_Model->GetLayer(0)->GetExtent().GetSize()[1]) && indexBegin[0]
> static_cast<unsigned int> (m_Model->GetLayer(0)->GetExtent().GetIndex()[0]) && indexBegin[1]
> static_cast<unsigned int> (m_Model->GetLayer(0)->GetExtent().GetIndex()[1]))
if (indexEnd[0] < static_cast<IndexValueType> (m_Model->GetLayer(0)->GetExtent().GetSize()[0])
&& indexEnd[1] < static_cast<IndexValueType> (m_Model->GetLayer(0)->GetExtent().GetSize()[1])
&& indexBegin[0] > static_cast<IndexValueType> (m_Model->GetLayer(0)->GetExtent().GetIndex()[0])
&& indexBegin[1] > static_cast<IndexValueType> (m_Model->GetLayer(0)->GetExtent().GetIndex()[1]))
{
m_Model->SetExtractRegionByIndex(indexBegin, indexEnd);
m_Model->Update();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment