2018-09-18 08:29:46 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2018 Statoil ASA
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "VdeExportPart.h"
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
VdeExportPart::VdeExportPart(cvf::Part* part)
|
|
|
|
: m_part(part)
|
2018-09-19 04:35:08 -05:00
|
|
|
, m_sourceObjectName("Unnamed Object")
|
|
|
|
, m_sourceObjectType(OBJ_TYPE_UNKNOWN)
|
|
|
|
, m_color(cvf::Color3f::MAGENTA)
|
|
|
|
, m_winding(COUNTERCLOCKWISE)
|
2018-09-19 12:50:03 -05:00
|
|
|
, m_opacity(1.0)
|
2018-09-18 08:29:46 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-09-20 09:15:13 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void VdeExportPart::setTextureImage(const cvf::TextureImage* textureImage)
|
|
|
|
{
|
|
|
|
m_textureImage = textureImage;
|
|
|
|
}
|
|
|
|
|
2018-09-18 08:29:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-19 04:35:08 -05:00
|
|
|
///
|
2018-09-18 08:29:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void VdeExportPart::setSourceObjectType(SourceObjectType sourceObjectType)
|
|
|
|
{
|
2018-09-19 04:35:08 -05:00
|
|
|
m_sourceObjectType = sourceObjectType;
|
2018-09-18 08:29:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-19 04:35:08 -05:00
|
|
|
///
|
2018-09-18 08:29:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void VdeExportPart::setSourceObjectName(const QString& sourceObjectName)
|
|
|
|
{
|
|
|
|
m_sourceObjectName = sourceObjectName;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-19 04:35:08 -05:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void VdeExportPart::setSourceObjectCellSetType(const QString& sourceObjectCellSetType)
|
|
|
|
{
|
|
|
|
m_sourceObjectCellSetType = sourceObjectCellSetType;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
2018-09-18 08:29:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-19 04:35:08 -05:00
|
|
|
void VdeExportPart::setColor(const cvf::Color3f& color)
|
2018-09-18 08:29:46 -05:00
|
|
|
{
|
|
|
|
m_color = color;
|
|
|
|
}
|
|
|
|
|
2018-09-19 05:51:28 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void VdeExportPart::setOpacity(float opacity)
|
|
|
|
{
|
|
|
|
m_opacity = opacity;
|
|
|
|
}
|
|
|
|
|
2018-09-18 08:29:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-19 04:35:08 -05:00
|
|
|
///
|
2018-09-18 08:29:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void VdeExportPart::setWinding(Winding winding)
|
|
|
|
{
|
|
|
|
m_winding = winding;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-19 04:35:08 -05:00
|
|
|
///
|
2018-09-18 08:29:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString VdeExportPart::sourceObjectName() const
|
|
|
|
{
|
|
|
|
return m_sourceObjectName;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-19 04:35:08 -05:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString VdeExportPart::sourceObjectCellSetType() const
|
|
|
|
{
|
|
|
|
return m_sourceObjectCellSetType;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
2018-09-18 08:29:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
VdeExportPart::SourceObjectType VdeExportPart::sourceObjectType() const
|
|
|
|
{
|
|
|
|
return m_sourceObjectType;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-19 04:35:08 -05:00
|
|
|
///
|
2018-09-18 08:29:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-19 07:33:08 -05:00
|
|
|
const cvf::Part* VdeExportPart::part() const
|
2018-09-18 08:29:46 -05:00
|
|
|
{
|
|
|
|
return m_part.p();
|
|
|
|
}
|
|
|
|
|
2018-09-20 09:15:13 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
const cvf::TextureImage* VdeExportPart::textureImage() const
|
|
|
|
{
|
|
|
|
return m_textureImage.p();
|
|
|
|
}
|
|
|
|
|
2018-09-18 08:29:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-19 04:35:08 -05:00
|
|
|
///
|
2018-09-18 08:29:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-19 04:35:08 -05:00
|
|
|
cvf::Color3f VdeExportPart::color() const
|
2018-09-18 08:29:46 -05:00
|
|
|
{
|
|
|
|
return m_color;
|
|
|
|
}
|
2018-09-19 12:50:03 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
float VdeExportPart::opacity() const
|
|
|
|
{
|
|
|
|
return m_opacity;
|
|
|
|
}
|
2018-09-20 09:15:13 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
VdeExportPart::Winding VdeExportPart::winding() const
|
|
|
|
{
|
|
|
|
return m_winding;
|
|
|
|
}
|