Changeset cc9225 for molecuilder/src
- Timestamp:
- Nov 24, 2009, 3:34:49 PM (16 years ago)
- Children:
- 1a3354
- Parents:
- 7d1ad9
- Location:
- molecuilder/src
- Files:
-
- 9 edited
-
boundary.cpp (modified) (1 diff)
-
builder.cpp (modified) (4 diffs)
-
config.cpp (modified) (1 diff)
-
molecule.hpp (modified) (1 diff)
-
molecule_pointcloud.cpp (modified) (1 diff)
-
moleculelist.cpp (modified) (2 diffs)
-
tesselation.cpp (modified) (2 diffs)
-
tesselation.hpp (modified) (2 diffs)
-
tesselationhelpers.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/boundary.cpp
r7d1ad9 rcc9225 671 671 OutputName.append(TecplotSuffix); 672 672 ofstream *tecplot = new ofstream(OutputName.c_str()); 673 WriteTecplotFile(tecplot, TesselStruct, mol, 0);673 WriteTecplotFile(tecplot, TesselStruct, mol, -1); 674 674 tecplot->close(); 675 675 delete(tecplot); -
molecuilder/src/builder.cpp
r7d1ad9 rcc9225 1247 1247 ofstream output; 1248 1248 molecule *mol = new molecule(periode); 1249 mol->SetNameFromFilename(ConfigFileName); 1249 1250 1250 1251 if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) { … … 1385 1386 int argptr; 1386 1387 molecule *mol = NULL; 1387 string BondGraphFileName(" ");1388 string BondGraphFileName("\n"); 1388 1389 int verbosity = 0; 1389 1390 strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1); … … 1539 1540 mol = new molecule(periode); 1540 1541 mol->ActiveFlag = true; 1542 if (ConfigFileName != NULL) 1543 mol->SetNameFromFilename(ConfigFileName); 1541 1544 molecules->insert(mol); 1545 } 1546 if (configuration.BG == NULL) { 1547 configuration.BG = new BondGraph(configuration.GetIsAngstroem()); 1548 if ((BondGraphFileName.empty()) && (configuration.BG->LoadBondLengthTable(BondGraphFileName))) { 1549 Log() << Verbose(0) << "Bond length table loaded successfully." << endl; 1550 } else { 1551 eLog() << Verbose(1) << "Bond length table loading failed." << endl; 1552 } 1542 1553 } 1543 1554 … … 1563 1574 else { 1564 1575 Log() << Verbose(2) << "File found and parsed." << endl; 1576 mol->SetNameFromFilename(argv[argptr]); 1577 molecules->ListOfMolecules.remove(mol); 1578 molecules->DissectMoleculeIntoConnectedSubgraphs(mol,&configuration); 1579 if (molecules->ListOfMolecules.size() != 0) { 1580 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 1581 if ((*ListRunner)->ActiveFlag) { 1582 mol = *ListRunner; 1583 break; 1584 } 1585 } 1565 1586 configPresent = present; 1566 1587 } -
molecuilder/src/config.cpp
r7d1ad9 rcc9225 1056 1056 1057 1057 // 2. parse the bond graph file if given 1058 BG = new BondGraph(IsAngstroem); 1059 if (BG->LoadBondLengthTable(BondGraphFileName)) { 1060 Log() << Verbose(0) << "Bond length table loaded successfully." << endl; 1061 } else { 1062 eLog() << Verbose(1) << "Bond length table loading failed." << endl; 1058 if (BG == NULL) { 1059 BG = new BondGraph(IsAngstroem); 1060 if (BG->LoadBondLengthTable(BondGraphFileName)) { 1061 Log() << Verbose(0) << "Bond length table loaded successfully." << endl; 1062 } else { 1063 eLog() << Verbose(1) << "Bond length table loading failed." << endl; 1064 } 1063 1065 } 1064 1066 1065 1067 // 3. parse the molecule in 1066 1068 LoadMolecule(mol, FileBuffer, periode, FastParsing); 1069 mol->SetNameFromFilename(filename); 1067 1070 mol->ActiveFlag = true; 1068 1071 -
molecuilder/src/molecule.hpp
r7d1ad9 rcc9225 106 106 107 107 // re-definition of virtual functions from PointCloud 108 const char * const GetName() const; 108 109 Vector *GetCenter() const ; 109 110 TesselPoint *GetPoint() const ; -
molecuilder/src/molecule_pointcloud.cpp
r7d1ad9 rcc9225 13 13 /************************************* Functions for class molecule *********************************/ 14 14 15 /** Returns a name for this point cloud, here the molecule's name. 16 * \return name of point cloud 17 */ 18 const char * const molecule::GetName() const 19 { 20 return name; 21 }; 15 22 16 23 /** Determine center of all atoms. -
molecuilder/src/moleculelist.cpp
r7d1ad9 rcc9225 760 760 // 4a. create array of molecules to fill 761 761 const int MolCount = Subgraphs->next->Count(); 762 char number[MAXSTRINGSIZE]; 762 763 molecule **molecules = Malloc<molecule *>(MolCount, "config::Load() - **molecules"); 763 764 for (int i=0;i<MolCount;i++) { 764 765 molecules[i] = (molecule*) new molecule(mol->elemente); 765 766 molecules[i]->ActiveFlag = true; 767 strncpy(molecules[i]->name, mol->name, MAXSTRINGSIZE); 768 if (MolCount > 1) { 769 sprintf(number, "-%d", i+1); 770 strncat(molecules[i]->name, number, MAXSTRINGSIZE - strlen(mol->name) - 1); 771 } 772 cout << "MolName is " << molecules[i]->name << endl; 766 773 insert(molecules[i]); 767 774 } … … 800 807 } 801 808 } 802 // 4d. we don't need to redo bonds, as they are connected subgraphs and still maintain edtheir ListOfBonds, but we have to remove them from first..last list809 // 4d. we don't need to redo bonds, as they are connected subgraphs and still maintain their ListOfBonds, but we have to remove them from first..last list 803 810 bond *Binder = mol->first; 804 811 while (mol->first->next != mol->last) { -
molecuilder/src/tesselation.cpp
r7d1ad9 rcc9225 1957 1957 BTS = NULL; 1958 1958 // check for present edges and whether we reach better candidates from them 1959 if (HasOtherBaselineBetterCandidate(BaseRay, (*it)->point, ShortestAngle, RADIUS, LC) ) { 1959 //if (HasOtherBaselineBetterCandidate(BaseRay, (*it)->point, ShortestAngle, RADIUS, LC) ) { 1960 if (0) { 1960 1961 result = false; 1961 1962 break; … … 3584 3585 } 3585 3586 delete(DegeneratedTriangles); 3587 if (count > 0) 3588 LastTriangle = NULL; 3586 3589 3587 3590 Log() << Verbose(1) << "RemoveDegeneratedTriangles() removed " << count << " triangles:" << endl; -
molecuilder/src/tesselation.hpp
r7d1ad9 rcc9225 170 170 virtual ~PointCloud(); 171 171 172 virtual const char * const GetName() const { return "unknown"; }; 172 173 virtual Vector *GetCenter() const { return NULL; }; 173 174 virtual TesselPoint *GetPoint() const { return NULL; }; … … 177 178 virtual void GoToFirst() const {}; 178 179 virtual void GoToLast() const {}; 179 virtual bool IsEmpty() const { return false; };180 virtual bool IsEnd() const { return false; };180 virtual bool IsEmpty() const { return true; }; 181 virtual bool IsEnd() const { return true; }; 181 182 }; 182 183 -
molecuilder/src/tesselationhelpers.cpp
r7d1ad9 rcc9225 756 756 { 757 757 Vector helper; 758 // include the current position of the virtual sphere in the temporary raster3d file 759 Vector *center = cloud->GetCenter(); 760 // make the circumsphere's center absolute again 761 helper.CopyVector(Tess->LastTriangle->endpoints[0]->node->node); 762 helper.AddVector(Tess->LastTriangle->endpoints[1]->node->node); 763 helper.AddVector(Tess->LastTriangle->endpoints[2]->node->node); 764 helper.Scale(1./3.); 765 helper.SubtractVector(center); 766 // and add to file plus translucency object 767 *rasterfile << "# current virtual sphere\n"; 768 *rasterfile << "8\n 25.0 0.6 -1.0 -1.0 -1.0 0.2 0 0 0 0\n"; 769 *rasterfile << "2\n " << helper.x[0] << " " << helper.x[1] << " " << helper.x[2] << "\t" << 5. << "\t1 0 0\n"; 770 *rasterfile << "9\n terminating special property\n"; 771 delete(center); 758 759 if (Tess->LastTriangle != NULL) { 760 // include the current position of the virtual sphere in the temporary raster3d file 761 Vector *center = cloud->GetCenter(); 762 // make the circumsphere's center absolute again 763 helper.CopyVector(Tess->LastTriangle->endpoints[0]->node->node); 764 helper.AddVector(Tess->LastTriangle->endpoints[1]->node->node); 765 helper.AddVector(Tess->LastTriangle->endpoints[2]->node->node); 766 helper.Scale(1./3.); 767 helper.SubtractVector(center); 768 // and add to file plus translucency object 769 *rasterfile << "# current virtual sphere\n"; 770 *rasterfile << "8\n 25.0 0.6 -1.0 -1.0 -1.0 0.2 0 0 0 0\n"; 771 *rasterfile << "2\n " << helper.x[0] << " " << helper.x[1] << " " << helper.x[2] << "\t" << 5. << "\t1 0 0\n"; 772 *rasterfile << "9\n terminating special property\n"; 773 delete(center); 774 } 772 775 }; 773 776 … … 829 832 *tecplot << "TITLE = \"3D CONVEX SHELL\"" << endl; 830 833 *tecplot << "VARIABLES = \"X\" \"Y\" \"Z\" \"U\"" << endl; 831 *tecplot << "ZONE T=\"" << N << "-"; 832 for (int i=0;i<3;i++) 833 *tecplot << (i==0 ? "" : "_") << TesselStruct->LastTriangle->endpoints[i]->node->Name; 834 *tecplot << "ZONE T=\""; 835 if (N < 0) { 836 *tecplot << cloud->GetName(); 837 } else { 838 *tecplot << N << "-"; 839 for (int i=0;i<3;i++) 840 *tecplot << (i==0 ? "" : "_") << TesselStruct->LastTriangle->endpoints[i]->node->Name; 841 } 834 842 *tecplot << "\", N=" << TesselStruct->PointsOnBoundary.size() << ", E=" << TesselStruct->TrianglesOnBoundary.size() << ", DATAPACKING=POINT, ZONETYPE=FETRIANGLE" << endl; 835 843 int i=0;
Note:
See TracChangeset
for help on using the changeset viewer.
