Commit 8aa0e1cf authored by Milan Jaros's avatar Milan Jaros
Browse files

add new version

parent 7708eb6b
......@@ -23,10 +23,10 @@
# all out-of-source builds will use the CMakeCache.txt file there and even
# build the libs and objects in it.
if(APPLE)
include_directories(/usr/local/Cellar/llvm/6.0.0/include)
link_directories(/usr/local/Cellar/llvm/6.0.0/lib)
endif()
#if(APPLE)
# include_directories(/usr/local/Cellar/llvm/6.0.0/include)
# link_directories(/usr/local/Cellar/llvm/6.0.0/lib)
#endif()
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
......
......@@ -697,11 +697,13 @@ function(SETUP_BLENDER_SORTED_LIBS)
covise_module_renderer_blenderrenderer
covise_module_general_vectorscal
covise_module_general_tracer
covise_module_general_transform
covise_module_general_selectusg
covise_module_general_partselect
covise_module_general_vectorfield
covise_module_general_sphere
covise_module_general_tube
covise_module_general_transform
covise_kernel_alg
covise_kernel_api
covise_kernel_appl
......
......@@ -392,9 +392,9 @@ if(WITH_OPENMP)
message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
set(OPENMP_CUSTOM ON)
set(OPENMP_FOUND ON)
set(OpenMP_C_FLAGS "-Xclang -fopenmp -I${LIBDIR}/openmp/include")
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I${LIBDIR}/openmp/include")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${LIBDIR}/openmp/lib -lomp")
set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L'${LIBDIR}/openmp/lib' -lomp")
# Copy libomp.dylib to allow executables like datatoc to work.
if(CMAKE_MAKE_PROGRAM MATCHES "xcodebuild")
......
......@@ -39,6 +39,10 @@ if(EXISTS ${LIBDIR})
set(WITH_OPENMP_STATIC ON)
endif()
if(WITH_STATIC_LIBS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
endif()
# Wrapper to prefer static libraries
macro(find_package_wrapper)
if(WITH_STATIC_LIBS)
......
......@@ -46,6 +46,7 @@ add_dependencies(bf_intern_covise
covise_module_general_minmax
covise_module_general_isolines
covise_module_general_tracer
covise_module_general_transform
covise_module_general_readansys
covise_module_general_readstl
covise_module_general_readply
......@@ -64,6 +65,7 @@ add_dependencies(bf_intern_covise
covise_module_general_sphere
covise_module_general_rwcovise
covise_module_general_tube
covise_module_general_transform
covise_kernel_alg
covise_kernel_api
covise_kernel_appl
......
......@@ -21,6 +21,7 @@ add_subdirectory(ReadVolume)
add_subdirectory(RWCovise)
add_subdirectory(SelectUsg)
add_subdirectory(Tracer)
add_subdirectory(Transform)
add_subdirectory(VectorScal)
add_subdirectory(MakePlots)
add_subdirectory(MinMax)
......
......@@ -269,19 +269,19 @@ DataFileGold::readCells()
} // if ( actPart->isActive()
else
{
EnPart *currPart = NULL;
EnPart currPart;
if (actPart == NULL)
{
// Actually, actPart should never be NULL since all (even deactivated) parts were added to the partList.
currPart = findMasterPart(actPartNr);
if (currPart->getPartNum() == 0)
if (currPart.getPartNum() == 0)
cerr << "DataFileGold::readCells() part with number " << actPartNr << "was not found in the master-part-list" << endl << "serious ERROR" << endl;
}
else
{
currPart = actPart;
currPart = *actPart;
}
int numParts = currPart->getNumEle();
int numParts = currPart.getNumEle();
// skip data
while (numParts > 0)
{
......@@ -293,7 +293,7 @@ DataFileGold::readCells()
// we have a valid ENSIGHT element
if (elem.valid())
{
anzEle = currPart->getElementNum(elementType);
anzEle = currPart.getElementNum(elementType);
numVal = anzEle * dim_;
fgets(buf, lineLen, in_);
++lineCnt_;
......@@ -377,9 +377,9 @@ DataFileGold::read()
}
else // Actually, actPart should never be NULL since all (even deactivated) parts were added to the partList.
{
EnPart *altPart = findMasterPart(actPartNr);
if (altPart->getPartNum() > 0)
numVal = altPart->numCoords();
EnPart altPart = findMasterPart(actPartNr);
if (altPart.getPartNum() > 0)
numVal = altPart.numCoords();
else
cerr << "DataFileGold::read() part with number " << actPartNr << "was not found in the master-part-list" << endl << "serious ERROR" << endl;
}
......
......@@ -76,7 +76,7 @@ DataFileGoldBin::readCells()
getStr();
size_t id(0);
int actPartNr;
EnPart *actPart = NULL;
EnPart *actPart(NULL);
int eleCnt2d = 0, eleCnt3d = 0;
while (!feof(in_))
......@@ -288,20 +288,20 @@ DataFileGoldBin::readCells()
// the part was not read during the geometry sweep
else
{
EnPart *currPart = NULL;
EnPart currPart;
if (actPart == NULL)
{
// Actually, actPart should never be NULL since all (even deactivated) parts were added to the partList.
currPart = findMasterPart(actPartNr);
if (currPart->getPartNum() == 0)
if (currPart.getPartNum() == 0)
cerr << "DataFileGoldBin::readCells() part with number " << actPartNr << "was not found in the master-part-list" << endl << "serious ERROR" << endl;
}
else
{
currPart = actPart;
currPart = *actPart;
}
int numParts = currPart->getNumEle();
int numParts = currPart.getNumEle();
// skip data
while ((!feof(in_)) && (numParts > 0))
{
......@@ -312,7 +312,7 @@ DataFileGoldBin::readCells()
// we have a valid ENSIGHT element
if (elem.valid())
{
anzEle = currPart->getElementNum(elementType);
anzEle = currPart.getElementNum(elementType);
switch (dim_)
{
case 1:
......@@ -405,9 +405,9 @@ DataFileGoldBin::read()
}
else // Actually, actPart should never be NULL since all (even deactivated) parts were added to the partList.
{
EnPart *altPart = findMasterPart(actPartNr);
if (altPart->getPartNum() > 0)
numVal = altPart->numCoords();
EnPart altPart = findMasterPart(actPartNr);
if (altPart.getPartNum() > 0)
numVal = altPart.numCoords();
else
cerr << "DataFileGoldBin::read() part with number " << actPartNr << "was not found in the master-part-list" << endl << "serious ERROR" << endl;
}
......
......@@ -31,8 +31,7 @@
class EnPart;
//typedef vector<EnPart*> PartList;
#define PartList vector<EnPart*>
typedef vector<EnPart> PartList;
// helper strip off spaces
string strip(const string &str);
......
......@@ -648,8 +648,8 @@ EnFile::findPart(const int &partNum) const
unsigned int i;
for (i = 0; i < partList_->size(); ++i)
{
if ((*partList_)[i]->getPartNum() == partNum)
return (*partList_)[i];
if ((*partList_)[i].getPartNum() == partNum)
return &(*partList_)[i];
}
}
return NULL;
......@@ -663,9 +663,9 @@ EnFile::resetPart(const int &partNum, EnPart *p)
unsigned int i;
for (i = 0; i < partList_->size(); ++i)
{
if ((*partList_)[i]->getPartNum() == partNum)
if ((*partList_)[i].getPartNum() == partNum)
{
(*partList_)[i] = p;
(*partList_)[i] = *p;
return;
}
}
......@@ -673,7 +673,7 @@ EnFile::resetPart(const int &partNum, EnPart *p)
}
// find a part by its part number in the master part list
EnPart *
EnPart
EnFile::findMasterPart(const int &partNum) const
{
if (!masterPL_.empty())
......@@ -681,11 +681,11 @@ EnFile::findMasterPart(const int &partNum) const
unsigned int i;
for (i = 0; i < masterPL_.size(); ++i)
{
if ((masterPL_)[i]->getPartNum() == partNum)
if ((masterPL_)[i].getPartNum() == partNum)
return masterPL_[i];
}
}
EnPart *dummy = new EnPart(-1);
EnPart dummy(-1);
return dummy;
}
......@@ -707,14 +707,14 @@ EnFile::buildParts(const bool &isPerVert)
int totalNumberOfElements(0);
for (i = 0; i < partList_->size(); ++i)
{
EnPart *p = (*partList_)[i];
if (p->isActive())
EnPart &p((*partList_)[i]);
if (p.isActive())
{
int numEle;
if (isPerVert)
numEle = p->numCoords();
numEle = p.numCoords();
else
numEle = p->getTotNumEle();
numEle = p.getTotNumEle();
totalNumberOfElements += numEle;
}
}
......@@ -747,24 +747,24 @@ EnFile::buildParts(const bool &isPerVert)
int cnt(0);
for (i = 0; i < partList_->size(); ++i)
{
EnPart *p = (*partList_)[i];
if (p->isActive())
EnPart &p((*partList_)[i]);
if (p.isActive())
{
int numEle;
if (isPerVert)
numEle = p->numCoords();
numEle = p.numCoords();
else
numEle = p->getTotNumEle();
numEle = p.getTotNumEle();
int j;
switch (dim_)
{
case 1:
if (p->arr1_ != NULL)
if (p.arr1_ != NULL)
{
for (j = 0; j < numEle; ++j)
{
dc_.x[cnt] = p->arr1_[j];
dc_.x[cnt] = p.arr1_[j];
cnt++;
}
}
......@@ -777,17 +777,17 @@ EnFile::buildParts(const bool &isPerVert)
}
}
// clean up
delete[] p->arr1_;
p->arr1_ = NULL;
delete[] p.arr1_;
p.arr1_ = NULL;
break;
case 3:
if (p->arr1_ != NULL)
if (p.arr1_ != NULL)
{
for (j = 0; j < numEle; ++j)
{
dc_.x[cnt] = p->arr1_[j];
dc_.y[cnt] = p->arr2_[j];
dc_.z[cnt] = p->arr3_[j];
dc_.x[cnt] = p.arr1_[j];
dc_.y[cnt] = p.arr2_[j];
dc_.z[cnt] = p.arr3_[j];
cnt++;
}
}
......@@ -802,12 +802,12 @@ EnFile::buildParts(const bool &isPerVert)
}
}
// clean up
delete[] p->arr1_;
p->arr1_ = NULL;
delete[] p->arr2_;
p->arr2_ = NULL;
delete[] p->arr3_;
p->arr3_ = NULL;
delete[] p.arr1_;
p.arr1_ = NULL;
delete[] p.arr2_;
p.arr2_ = NULL;
delete[] p.arr3_;
p.arr3_ = NULL;
break;
}
}
......@@ -851,10 +851,10 @@ EnFile::sendPartsToInfo()
int cnt(0);
if (partList_ != NULL)
{
PartList::iterator pos(partList_->begin());
vector<EnPart>::iterator pos(partList_->begin());
for (; pos != partList_->end(); pos++)
{
module_->sendInfo("%s", ((*pos)->partInfoString(cnt)).c_str());
module_->sendInfo("%s", (pos->partInfoString(cnt)).c_str());
cnt++;
}
}
......
......@@ -196,7 +196,7 @@ protected:
virtual EnPart *findPart(const int &partNum) const;
// find a part by its part number in the master part list
virtual EnPart *findMasterPart(const int &partNum) const;
virtual EnPart findMasterPart(const int &partNum) const;
virtual void resetPart(const int &partNum, EnPart *p);
......
......@@ -81,7 +81,7 @@ EnGoldGeoASC::read()
unsigned int ii;
for (ii = 0; ii < masterPL_.size(); ++ii)
{
if (masterPL_[ii]->isActive())
if (masterPL_[ii].isActive())
{
allPartsToRead++;
}
......@@ -94,12 +94,12 @@ EnGoldGeoASC::read()
PartList::iterator it(masterPL_.begin());
for (; it != masterPL_.end(); it++)
{
if ((*it)->isActive())
if (it->isActive())
{
EnPart *part = new EnPart();
EnPart part;
readPart(part);
readPartConn(part);
sprintf(buf, "read part#%d : %d of %d", (*it)->getPartNum(), cnt, allPartsToRead);
sprintf(buf, "read part#%d : %d of %d", it->getPartNum(), cnt, allPartsToRead);
module_->sendInfo("%s", buf);
cnt++;
}
......@@ -237,7 +237,7 @@ EnGoldGeoASC::readHeader()
}
int
EnGoldGeoASC::readPart(EnPart *actPart)
EnGoldGeoASC::readPart(EnPart &actPart)
{
int ret(0);
int partNo;
......@@ -258,7 +258,7 @@ EnGoldGeoASC::readPart(EnPart *actPart)
++lineCnt_;
noRead = sscanf(buf, "%d", &partNo);
actPartNumber_ = partNo;
actPart->setPartNum(partNo);
actPart.setPartNum(partNo);
//cerr << className_ << "::readPart() got part No: " << partNo << endl;
if (noRead != 1)
{
......@@ -269,7 +269,7 @@ EnGoldGeoASC::readPart(EnPart *actPart)
// description line
fgets(buf, lineLen, in_);
++lineCnt_;
actPart->setComment(buf);
actPart.setComment(buf);
// coordinates token
fgets(buf, lineLen, in_);
++lineCnt_;
......@@ -403,10 +403,10 @@ EnGoldGeoASC::readPart(EnPart *actPart)
}
break;
}
actPart->x3d_ = x;
actPart->y3d_ = y;
actPart->z3d_ = z;
actPart->setNumCoords(numCoords);
actPart.x3d_ = x;
actPart.y3d_ = y;
actPart.z3d_ = z;
actPart.setNumCoords(numCoords);
}
else
cerr << className_ << "::readPart() " << lineCnt_ << " NO part header found" << endl;
......@@ -416,7 +416,7 @@ EnGoldGeoASC::readPart(EnPart *actPart)
}
int
EnGoldGeoASC::readPartConn(EnPart *actPart)
EnGoldGeoASC::readPartConn(EnPart &actPart)
{
int &partNo(actPartNumber_);
......@@ -550,7 +550,7 @@ EnGoldGeoASC::readPartConn(EnPart *actPart)
}
lastNc_ = nc;
elem.setBlacklist(blacklist);
actPart->addElement(elem, numElements);
actPart.addElement(elem, numElements);
}
}
// we have read one line more than needed
......@@ -582,16 +582,16 @@ EnGoldGeoASC::readPartConn(EnPart *actPart)
std::copy(typeLst3d.begin(), typeLst3d.end(), typePtr3d);
std::copy(cornLst2d.begin(), cornLst2d.end(), connPtr2d);
std::copy(cornLst3d.begin(), cornLst3d.end(), connPtr3d);
actPart->setNumEleRead2d(eleLst2d.size());
actPart->setNumEleRead3d(eleLst3d.size());
actPart->setNumConnRead2d(cornLst2d.size());
actPart->setNumConnRead3d(cornLst3d.size());
actPart->el2d_ = elePtr2d;
actPart->tl2d_ = typePtr2d;
actPart->cl2d_ = connPtr2d;
actPart->el3d_ = elePtr3d;
actPart->tl3d_ = typePtr3d;
actPart->cl3d_ = connPtr3d;
actPart.setNumEleRead2d(eleLst2d.size());
actPart.setNumEleRead3d(eleLst3d.size());
actPart.setNumConnRead2d(cornLst2d.size());
actPart.setNumConnRead3d(cornLst3d.size());
actPart.el2d_ = elePtr2d;
actPart.tl2d_ = typePtr2d;
actPart.cl2d_ = connPtr2d;
actPart.el3d_ = elePtr3d;
actPart.tl3d_ = typePtr3d;
actPart.cl3d_ = connPtr3d;
partList_->push_back(actPart);
}
......@@ -635,7 +635,7 @@ EnGoldGeoASC::parseForParts()
int numParts(0);
int totNumElements;
EnPart *actPart = NULL;
EnPart *actPart(NULL);
readHeader();
module_->sendInfo("%s", "getting parts - please wait...");
......@@ -704,8 +704,8 @@ EnGoldGeoASC::parseForParts()
{
if (actPart != NULL)
{
partList_->push_back(actPart);
//delete actPart;
partList_->push_back(*actPart);
delete actPart;
}
}
actPart = new EnPart(actPartNr, comment);
......@@ -773,8 +773,8 @@ EnGoldGeoASC::parseForParts()
{
if (actPart != NULL)
{
partList_->push_back(actPart);
//delete actPart;
partList_->push_back(*actPart);
delete actPart;
}
}
else
......@@ -798,11 +798,11 @@ EnGoldGeoASC::allocateMemory()
unsigned int ii;
for (ii = 0; ii < masterPL_.size(); ++ii)
{
if (masterPL_[ii]->isActive())
if (masterPL_[ii].isActive())
{
totNumEle += masterPL_[ii]->getTotNumEle();
totNumCorners += masterPL_[ii]->getTotNumberOfCorners();
totNumCoords += masterPL_[ii]->numCoords();
totNumEle += masterPL_[ii].getTotNumEle();
totNumCorners += masterPL_[ii].getTotNumberOfCorners();
totNumCoords += masterPL_[ii].numCoords();
}
}
// prepare dc - allocate fields
......@@ -842,8 +842,8 @@ EnGoldGeoASC::skipPart()
// Even in skipPart we add the part (with basic information) to the partList but deactivate it.
// We need it for skipping the corresponding data in case of "really" transient grids.
EnPart *actPart = new EnPart();
actPart->activate(false);
EnPart actPart;
actPart.activate(false);
fgets(buf, lineLen, in_);
++lineCnt_;
......@@ -860,13 +860,13 @@ EnGoldGeoASC::skipPart()
fgets(buf, lineLen, in_);
++lineCnt_;
int actPartNr = atoi(buf);
actPart->setPartNum(actPartNr);
actPart.setPartNum(actPartNr);
// comment line we need it for the table output
fgets(buf, lineLen, in_);
++lineCnt_;
string comment(buf);
actPart->setComment(comment);
actPart.setComment(comment);
// coordinates token
fgets(buf, lineLen, in_);
......@@ -880,7 +880,7 @@ EnGoldGeoASC::skipPart()
fgets(buf, lineLen, in_);
++lineCnt_;
numCoords = atoi(buf);
actPart->setNumCoords(numCoords);
actPart.setNumCoords(numCoords);
//cerr << className_ << "::skipPart() numCoords " << numCoords << endl;
switch (nodeId_)
{
......@@ -953,7 +953,7 @@ EnGoldGeoASC::skipPart()
fseek(in_, ((nc * 10) + 1) * numElements, SEEK_CUR);
#endif
}
actPart->addElement(elem, numElements);
actPart.addElement(elem, numElements);
}
} // if( elem.valid() )
......
......@@ -50,10 +50,10 @@ private:
int readHeader();
// read Ensight part information
int readPart(EnPart *actPart);
int readPart(EnPart &actPart);
// read part connectivities (ENSIGHT Gold only)
int readPartConn(EnPart *actPart);
int readPartConn(EnPart &actPart);
// read bounding box (ENSIGHT Gold)
int readBB();
......
......@@ -27,7 +27,7 @@
#include <vector>
#undef DEBUG
// #define DEBUG
//
// Constructor
......@@ -103,7 +103,7 @@ EnGoldGeoBIN::read()
unsigned int ii;
for (ii = 0; ii < masterPL_.size(); ++ii)
{
if (masterPL_[ii]->isActive())
if (masterPL_[ii].isActive())
{
allPartsToRead++;
}
......@@ -117,12 +117,12 @@ EnGoldGeoBIN::read()
PartList::iterator it(masterPL_.begin());
for (; it != masterPL_.end(); it++)
{
if ((*it)->isActive())
if (it->isActive())
{
EnPart *part = new EnPart();