mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3773 Annotations. Remove annotation color factory class
This commit is contained in:
parent
bbec88b5d1
commit
76e8aa9652
@ -19,8 +19,8 @@
|
|||||||
#include "RicCreateReachCircleAnnotationFeature.h"
|
#include "RicCreateReachCircleAnnotationFeature.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
#include "RiaColorTables.h"
|
||||||
|
|
||||||
#include "RimAnnotationColorFactory.h"
|
|
||||||
#include "RimTextAnnotation.h"
|
#include "RimTextAnnotation.h"
|
||||||
#include "RimReachCircleAnnotation.h"
|
#include "RimReachCircleAnnotation.h"
|
||||||
#include "RimPolylinesAnnotation.h"
|
#include "RimPolylinesAnnotation.h"
|
||||||
@ -57,7 +57,7 @@ void RicCreateReachCircleAnnotationFeature::onActionTriggered(bool isChecked)
|
|||||||
if (coll)
|
if (coll)
|
||||||
{
|
{
|
||||||
auto newAnnotation = new RimReachCircleAnnotation();
|
auto newAnnotation = new RimReachCircleAnnotation();
|
||||||
auto newColor = RimAnnotationColorFactory::getColor(coll->lineBasedAnnotationsCount());
|
auto newColor = RiaColorTables::categoryPaletteColors().cycledColor3f(coll->lineBasedAnnotationsCount());
|
||||||
newAnnotation->appearance()->setColor(newColor);
|
newAnnotation->appearance()->setColor(newColor);
|
||||||
coll->addAnnotation(newAnnotation);
|
coll->addAnnotation(newAnnotation);
|
||||||
coll->updateConnectedEditors();
|
coll->updateConnectedEditors();
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
#include "RicCreateUserDefinedPolylinesAnnotationFeature.h"
|
#include "RicCreateUserDefinedPolylinesAnnotationFeature.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
#include "RiaColorTables.h"
|
||||||
|
|
||||||
#include "RimAnnotationColorFactory.h"
|
|
||||||
#include "RimTextAnnotation.h"
|
#include "RimTextAnnotation.h"
|
||||||
#include "RimReachCircleAnnotation.h"
|
#include "RimReachCircleAnnotation.h"
|
||||||
#include "RimUserDefinedPolylinesAnnotation.h"
|
#include "RimUserDefinedPolylinesAnnotation.h"
|
||||||
@ -57,7 +57,7 @@ void RicCreateUserDefinedPolylinesAnnotationFeature::onActionTriggered(bool isCh
|
|||||||
if (coll)
|
if (coll)
|
||||||
{
|
{
|
||||||
auto newAnnotation = new RimUserDefinedPolylinesAnnotation();
|
auto newAnnotation = new RimUserDefinedPolylinesAnnotation();
|
||||||
auto newColor = RimAnnotationColorFactory::getColor(coll->lineBasedAnnotationsCount());
|
auto newColor = RiaColorTables::categoryPaletteColors().cycledColor3f(coll->lineBasedAnnotationsCount());
|
||||||
newAnnotation->appearance()->setColor(newColor);
|
newAnnotation->appearance()->setColor(newColor);
|
||||||
coll->addAnnotation(newAnnotation);
|
coll->addAnnotation(newAnnotation);
|
||||||
coll->updateConnectedEditors();
|
coll->updateConnectedEditors();
|
||||||
|
@ -10,7 +10,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotation.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationInViewCollection.h
|
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationInViewCollection.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationLineAppearance.h
|
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationLineAppearance.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimLineBasedAnnotation.h
|
${CMAKE_CURRENT_LIST_DIR}/RimLineBasedAnnotation.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationColorFactory.h
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
@ -24,7 +23,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotation.cpp
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationInViewCollection.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationInViewCollection.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationLineAppearance.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationLineAppearance.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimLineBasedAnnotation.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimLineBasedAnnotation.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimAnnotationColorFactory.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES
|
list(APPEND CODE_HEADER_FILES
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
#include "RimAnnotationCollection.h"
|
#include "RimAnnotationCollection.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
#include "RiaColorTables.h"
|
||||||
|
|
||||||
#include "RimAnnotationColorFactory.h"
|
|
||||||
#include "RimTextAnnotation.h"
|
#include "RimTextAnnotation.h"
|
||||||
#include "RimReachCircleAnnotation.h"
|
#include "RimReachCircleAnnotation.h"
|
||||||
#include "RimPolylinesFromFileAnnotation.h"
|
#include "RimPolylinesFromFileAnnotation.h"
|
||||||
@ -160,7 +160,7 @@ RimPolylinesFromFileAnnotation* RimAnnotationCollection::importOrUpdatePolylines
|
|||||||
{
|
{
|
||||||
RimPolylinesFromFileAnnotation* newPolyLinesAnnot = new RimPolylinesFromFileAnnotation;
|
RimPolylinesFromFileAnnotation* newPolyLinesAnnot = new RimPolylinesFromFileAnnotation;
|
||||||
|
|
||||||
auto newColor = RimAnnotationColorFactory::getColor(lineBasedAnnotationsCount());
|
auto newColor = RiaColorTables::categoryPaletteColors().cycledColor3f(lineBasedAnnotationsCount());
|
||||||
|
|
||||||
newPolyLinesAnnot->setFileName(newFileName);
|
newPolyLinesAnnot->setFileName(newFileName);
|
||||||
newPolyLinesAnnot->setDescriptionFromFileName();
|
newPolyLinesAnnot->setDescriptionFromFileName();
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Copyright (C) 2018- Equinor 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 "RimAnnotationColorFactory.h"
|
|
||||||
|
|
||||||
#include "RiaColorTables.h"
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
cvf::Color3f RimAnnotationColorFactory::getColor(int index)
|
|
||||||
{
|
|
||||||
return RiaColorTables::categoryPaletteColors().cycledColor3f(index);
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Copyright (C) 2018- Equinor 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 <cvfBase.h>
|
|
||||||
#include <cvfColor3.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//==================================================================================================
|
|
||||||
///
|
|
||||||
///
|
|
||||||
//==================================================================================================
|
|
||||||
class RimAnnotationColorFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static cvf::Color3f getColor(int index);
|
|
||||||
};
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user