MEDCouplingFieldTemplate *MEDCouplingFieldTemplate::New(const MEDCouplingFieldDouble& f)
{
- return new MEDCouplingFieldTemplate(f);
+ return new MEDCouplingFieldTemplate(f,true);
}
MEDCouplingFieldTemplate *MEDCouplingFieldTemplate::New(const MEDCouplingFieldFloat& f)
{
- return new MEDCouplingFieldTemplate(f);
+ return new MEDCouplingFieldTemplate(f,true);
}
MEDCouplingFieldTemplate *MEDCouplingFieldTemplate::New(const MEDCouplingFieldInt& f)
{
- return new MEDCouplingFieldTemplate(f);
+ return new MEDCouplingFieldTemplate(f,true);
+}
+
+MEDCouplingFieldTemplate *MEDCouplingFieldTemplate::NewWithoutCheck(const MEDCouplingFieldDouble& f)
+{
+ return new MEDCouplingFieldTemplate(f,false);
+}
+
+MEDCouplingFieldTemplate *MEDCouplingFieldTemplate::NewWithoutCheck(const MEDCouplingFieldFloat& f)
+{
+ return new MEDCouplingFieldTemplate(f,false);
+}
+
+MEDCouplingFieldTemplate *MEDCouplingFieldTemplate::NewWithoutCheck(const MEDCouplingFieldInt& f)
+{
+ return new MEDCouplingFieldTemplate(f,false);
}
/*!
return new MEDCouplingFieldTemplate(type);
}
-MEDCouplingFieldTemplate::MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f):MEDCouplingField(f,false)
+MEDCouplingFieldTemplate::MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f, bool isChecked):MEDCouplingField(f,false)
{
forceTimeOfThis(f);
- checkConsistencyLight();
+ if(isChecked)
+ checkConsistencyLight();
}
-MEDCouplingFieldTemplate::MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f):MEDCouplingField(f,false)
+MEDCouplingFieldTemplate::MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f, bool isChecked):MEDCouplingField(f,false)
{
forceTimeOfThis(f);
- checkConsistencyLight();
+ if(isChecked)
+ checkConsistencyLight();
}
-MEDCouplingFieldTemplate::MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f):MEDCouplingField(f,false)
+MEDCouplingFieldTemplate::MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f, bool isChecked):MEDCouplingField(f,false)
{
forceTimeOfThis(f);
- checkConsistencyLight();
+ if(isChecked)
+ checkConsistencyLight();
}
MEDCouplingFieldTemplate::MEDCouplingFieldTemplate(TypeOfField type):MEDCouplingField(type)
MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *New(const MEDCouplingFieldFloat& f);
MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *New(const MEDCouplingFieldInt& f);
MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *New(TypeOfField type);
+ MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *NewWithoutCheck(const MEDCouplingFieldDouble& f);
+ MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *NewWithoutCheck(const MEDCouplingFieldFloat& f);
+ MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *NewWithoutCheck(const MEDCouplingFieldInt& f);
MEDCOUPLING_EXPORT std::string simpleRepr() const;
MEDCOUPLING_EXPORT std::string advancedRepr() const;
MEDCOUPLING_EXPORT void checkConsistencyLight() const;
//
MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
private:
- MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f);
- MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f);
- MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f);
+ MEDCouplingFieldTemplate(const MEDCouplingFieldDouble& f, bool isChecked=true);
+ MEDCouplingFieldTemplate(const MEDCouplingFieldFloat& f, bool isChecked=true);
+ MEDCouplingFieldTemplate(const MEDCouplingFieldInt& f, bool isChecked=true);
MEDCouplingFieldTemplate(TypeOfField type);
MEDCouplingFieldTemplate(const MEDCouplingFieldTemplate& other, bool deepCopy);
};
void MEDFileField1TS::setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile)
{
setFileName("");
- MCAuto<MEDCouplingFieldTemplate> ft(MEDCouplingFieldTemplate::New(*field));
+ MCAuto<MEDCouplingFieldTemplate> ft(MEDCouplingFieldTemplate::NewWithoutCheck(*field));
contentNotNull()->setFieldProfile(field->timeDiscrSafe(),ft,field->getArray(),mesh,meshDimRelToMax,profile,*this,*contentNotNull());
}
void MEDFileIntField1TS::setFieldProfile(const MEDCouplingFieldInt *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile)
{
setFileName("");
- MCAuto<MEDCouplingFieldTemplate> ft(MEDCouplingFieldTemplate::New(*field));
+ MCAuto<MEDCouplingFieldTemplate> ft(MEDCouplingFieldTemplate::NewWithoutCheck(*field));
contentNotNull()->setFieldProfile(field->timeDiscrSafe(),ft,field->getArray(),mesh,meshDimRelToMax,profile,*this,*contentNotNull());
}
MEDFileAnyTypeField1TSWithoutSDA *objC=createNew1TSWithoutSDAEmptyInstance();
MCAuto<MEDFileAnyTypeField1TSWithoutSDA> obj(objC);
{
- MCAuto<MEDCouplingFieldTemplate> ft(MEDCouplingFieldTemplate::New(*field));
+ MCAuto<MEDCouplingFieldTemplate> ft(MEDCouplingFieldTemplate::NewWithoutCheck(*field));
objC->setFieldProfile(field->timeDiscrSafe(),ft,arr,mesh,meshDimRelToMax,profile,glob,*this);
}
copyTinyInfoFrom(field,arr);