|
[Sponsors] |
December 20, 2013, 11:16 |
Nested class and inheritance permissions
|
#1 |
New Member
Matteo
Join Date: Sep 2013
Location: Milan, Italy
Posts: 9
Rep Power: 13 |
Hello everybody!
I'm quite new both to OpenFoam and C++ language. My problem, actually, is to create a class in which I need to create an object belonging to the treeDataFace class. Then , on this object, I need to call a method of the indexedOctree class, which is already contained in treeDataFace.h file. I have some problems in making the class. Here's the code: 1) header file Code:
#include "treeDataFace.H" ... namespace Foam { class intersectionData { public: intersectionData(const fvMesh &iMesh); ~intersectionData(); ... void findCellIntersctPts(point &ipStart, point &ipEnd, const fvMesh &iMesh); treeBoundBox allBb; scalar bbTol; indexedOctree<treeDataFace> faceTree(treeDataFace(const bool &f,const fvMesh &iMesh),treeBoundBox &allBb,int(a),int(b) ,double(c)); }; } Code:
#include "intersectionData.h" ... #include "polyMesh.H" #include "meshTools.H" #include "treeDataFace.H" namespace Foam { intersectionData::intersectionData(const fvMesh &iMesh) { ... indexedOctree<treeDataFace> faceTree ( treeDataFace(false,iMesh), allBb, 8, 10, 3.0 ); } intersectionData::~intersectionData() {} void intersectionData::findCellIntersctPts(point &ipStart, point &ipEnd, const fvMesh &iMesh) { ... point p0 point p1 { pointIndexHit pHit = faceTree.findLine(p0, p1); ... } } Code:
intersectionData.cpp: In member function ‘void Foam::intersectionData::findCellIntersctPts(Foam::point&, Foam::point&, const Foam::fvMesh&)’: intersectionData.cpp:95:35: error: ‘((Foam::intersectionData*)this)->Foam::intersectionData::faceTree’ does not have class type pointIndexHit pHit = faceTree.findLine(p0, p1); I don't know how resolve, thank you in advance for your help! Regards from Italy! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
function objects and virtual inheritance | MichiB | OpenFOAM Programming & Development | 1 | September 15, 2015 20:29 |
Doxygen documentation | Tanay | OpenFOAM Installation | 9 | September 23, 2011 12:40 |
Multiple inheritance, function pointers or? | ngj | OpenFOAM | 0 | March 20, 2009 11:36 |