Thread: node thing.

  1. #1
    Unregistered
    Guest

    node thing.

    I've tried to make a structure of nodes where each node have a different type and different data which it store about itself, but I can't find any information on it. Maybee since I don't know what this kind of structure is called.

    node(bsptree)
    / node(triangle)
    / /
    / /
    node(octree)-------------node(binary space partitioning tree)
    \ \
    \ \
    \ \
    node(cube) node(furry rabbit)

    If anyone knows how to create a structure of this type please submit a reply.

  2. #2
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    I don't know specifically what structure nodes in a bsp have, but I'll assume it's just like a regular binary tree.

    Code:
    class BspNode {
    public:
    // whatever
    protected:
    BstNode* right;
    BstNode* left;
    };
    
    class TriangleNode : public BspNode {
    public:
    Triangle tri;
    };
    
    class CubeNode: public BspNode {
    public:
    Cube cube;
    };
    etc.
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Concatenating in linked list
    By drater in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 11:10 PM
  2. Replies: 7
    Last Post: 06-16-2006, 09:23 PM
  3. Program Crashing
    By Pressure in forum C Programming
    Replies: 3
    Last Post: 04-18-2005, 10:28 PM
  4. Binary Tree, couple questions
    By scoobasean in forum C Programming
    Replies: 3
    Last Post: 03-12-2005, 09:09 PM
  5. Big help in Astar search code...
    By alvifarooq in forum C++ Programming
    Replies: 6
    Last Post: 09-24-2004, 11:38 AM