2016-09-20 05:03:26 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2016- 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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
#include "cafPdmField.h"
|
|
|
|
|
|
|
|
#include "cvfBoundingBox.h"
|
|
|
|
|
2016-09-21 07:40:50 -05:00
|
|
|
class RivIntersectionBoxPartMgr;
|
2016-09-20 05:03:26 -05:00
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
|
|
|
class RimIntersectionBox : public caf::PdmObject
|
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
2016-09-23 04:37:33 -05:00
|
|
|
public:
|
|
|
|
enum SinglePlaneState
|
|
|
|
{
|
|
|
|
PLANE_STATE_NONE,
|
|
|
|
PLANE_STATE_X,
|
|
|
|
PLANE_STATE_Y,
|
|
|
|
PLANE_STATE_Z
|
|
|
|
};
|
|
|
|
|
2016-09-20 05:03:26 -05:00
|
|
|
public:
|
|
|
|
RimIntersectionBox();
|
|
|
|
~RimIntersectionBox();
|
|
|
|
|
|
|
|
// Fields
|
2016-09-21 07:21:45 -05:00
|
|
|
caf::PdmField<QString> name;
|
|
|
|
caf::PdmField<bool> isActive;
|
2016-09-20 05:03:26 -05:00
|
|
|
|
2016-09-21 07:21:45 -05:00
|
|
|
cvf::Mat4d boxOrigin() const;
|
|
|
|
cvf::Vec3d boxSize() const;
|
2016-09-27 04:28:39 -05:00
|
|
|
SinglePlaneState singlePlaneState() const;
|
2016-09-21 07:21:45 -05:00
|
|
|
|
2016-09-21 07:40:50 -05:00
|
|
|
RivIntersectionBoxPartMgr* intersectionBoxPartMgr();
|
|
|
|
|
2016-09-28 05:39:43 -05:00
|
|
|
void setToDefaultSizeBox();
|
|
|
|
void setToDefaultSizeSlice(SinglePlaneState plane, const cvf::Vec3d& position);
|
2016-09-22 03:38:57 -05:00
|
|
|
|
2016-09-20 05:03:26 -05:00
|
|
|
protected:
|
|
|
|
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
|
|
|
virtual caf::PdmFieldHandle* objectToggleField() override;
|
|
|
|
|
|
|
|
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
|
|
|
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
|
|
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
2016-09-23 04:37:33 -05:00
|
|
|
virtual void initAfterRead() override;
|
2016-09-20 05:03:26 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
void rebuildGeometryAndScheduleCreateDisplayModel();
|
2016-09-23 04:37:33 -05:00
|
|
|
void updateVisibility();
|
2016-09-28 05:39:43 -05:00
|
|
|
void updateLabelsFromBoundingBox();
|
2016-09-23 04:37:33 -05:00
|
|
|
void clampSinglePlaneValues();
|
2016-09-20 05:03:26 -05:00
|
|
|
|
|
|
|
private:
|
2016-09-27 04:28:39 -05:00
|
|
|
caf::PdmField<caf::AppEnum< SinglePlaneState > > m_singlePlaneState;
|
2016-09-23 04:37:33 -05:00
|
|
|
|
2016-09-27 04:28:39 -05:00
|
|
|
caf::PdmField<double> m_minXCoord;
|
|
|
|
caf::PdmField<double> m_minYCoord;
|
|
|
|
caf::PdmField<double> m_minZCoord;
|
2016-09-20 05:03:26 -05:00
|
|
|
|
2016-09-27 04:28:39 -05:00
|
|
|
caf::PdmField<double> m_maxXCoord;
|
|
|
|
caf::PdmField<double> m_maxYCoord;
|
|
|
|
caf::PdmField<double> m_maxZCoord;
|
2016-09-20 05:03:26 -05:00
|
|
|
|
|
|
|
|
2016-09-28 05:39:43 -05:00
|
|
|
cvf::BoundingBox currentCellBoundingBox();
|
2016-09-21 07:40:50 -05:00
|
|
|
|
|
|
|
cvf::ref<RivIntersectionBoxPartMgr> m_intersectionBoxPartMgr;
|
2016-09-20 05:03:26 -05:00
|
|
|
};
|