mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5671 Move caf::PdmFieldScriptability<cvf::Color3f> into cafPdmCvf
This commit is contained in:
committed by
Magne Sjaastad
parent
2853308a4a
commit
ba0ded23c3
@@ -35,8 +35,6 @@
|
||||
//##################################################################################################
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
|
||||
#include <QColor>
|
||||
|
||||
using namespace caf;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -185,37 +183,3 @@ void PdmFieldScriptabilityIOHandler<bool>::readFromField( const bool& fieldValu
|
||||
// Lower-case true/false is used in the documentation.
|
||||
outputStream << ( fieldValue ? "true" : "false" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmFieldScriptabilityIOHandler<cvf::Color3f>::writeToField( cvf::Color3f& fieldValue,
|
||||
QTextStream& inputStream,
|
||||
caf::PdmScriptIOMessages* errorMessageContainer,
|
||||
bool stringsAreQuoted )
|
||||
{
|
||||
QString fieldStringValue;
|
||||
PdmFieldScriptabilityIOHandler<QString>::writeToField( fieldStringValue,
|
||||
inputStream,
|
||||
errorMessageContainer,
|
||||
stringsAreQuoted );
|
||||
|
||||
QColor qColor( fieldStringValue );
|
||||
if ( qColor.isValid() )
|
||||
{
|
||||
fieldValue = cvf::Color3f( qColor.redF(), qColor.greenF(), qColor.blueF() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmFieldScriptabilityIOHandler<cvf::Color3f>::readFromField( const cvf::Color3f& fieldValue,
|
||||
QTextStream& outputStream,
|
||||
bool quoteStrings,
|
||||
bool quoteNonBuiltin )
|
||||
{
|
||||
QColor qColor( fieldValue.rByte(), fieldValue.gByte(), fieldValue.bByte() );
|
||||
QString fieldStringValue = qColor.name();
|
||||
PdmFieldScriptabilityIOHandler<QString>::readFromField( fieldStringValue, outputStream, quoteStrings );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user