Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
nodelist.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19/* $Header: /Commando/Code/Tools/pluglib/nodelist.h 7 1/02/01 6:31p Greg_h $ */
20/***********************************************************************************************
21 *** Confidential - Westwood Studios ***
22 ***********************************************************************************************
23 * *
24 * Project Name : Commando / G *
25 * *
26 * File Name : NODELIST.H *
27 * *
28 * Programmer : Greg Hjelstrom *
29 * *
30 * Start Date : 06/09/97 *
31 * *
32 * Last Update : June 9, 1997 [GH] *
33 * *
34 *---------------------------------------------------------------------------------------------*
35 * Functions: *
36 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
37
38
39#ifndef NODELIST_H
40#define NODELIST_H
41
42#include "always.h"
43#include <Max.h>
44
45#ifndef NODEFILT_H
46#include "nodefilt.h"
47#endif
48
49
52
53
54/*******************************************************************************
55* INodeListClass
56*
57* This is a class that can enumerate a 3dsMax scene and build a list of
58* all of the INodes that meet your desired criteria.
59*
60*******************************************************************************/
61class INodeListClass : public ITreeEnumProc
62{
63public:
64
65 INodeListClass(TimeValue time,INodeFilterClass * nodefilter = NULL);
66 INodeListClass(IScene * scene,TimeValue time,INodeFilterClass * nodefilter = NULL);
67 INodeListClass(INode * root,TimeValue time,INodeFilterClass * nodefilter = NULL);
68 INodeListClass(INodeListClass & copyfrom,TimeValue time,INodeFilterClass * inodefilter = NULL);
70
71 void Set_Filter(INodeFilterClass * inodefilter) { INodeFilter = inodefilter; }
72 void Insert(INodeListClass & insertlist);
73 void Insert(INode * node);
74 void Remove(int i);
75 unsigned Num_Nodes(void) const { return NumNodes; }
76 INode * operator[] (int index) const;
77 void Sort(const INodeCompareClass & node_compare);
78 void Add_Tree(INode * root);
79
80private:
81
82 unsigned NumNodes;
83 TimeValue Time;
84 INodeListEntryClass * ListHead;
85 INodeFilterClass * INodeFilter;
86
87 INodeListEntryClass * get_nth_item(int index);
88 int callback(INode * node);
89};
90
91
93{
94public:
95 // returns <0 if nodea < node b.
96 // returns =0 if nodea = node b.
97 // returns >0 if nodea > node b.
98 virtual int operator() (INode * nodea,INode * nodeb) const = 0;
99};
100
101
102#endif /*NODELIST_H*/
#define NULL
Definition BaseType.h:92
virtual int operator()(INode *nodea, INode *nodeb) const =0
INode * operator[](int index) const
Definition nodelist.cpp:214
INodeListClass(TimeValue time, INodeFilterClass *nodefilter=NULL)
Definition nodelist.cpp:84
void Add_Tree(INode *root)
Definition nodelist.cpp:312
void Set_Filter(INodeFilterClass *inodefilter)
Definition nodelist.h:71
void Remove(int i)
Definition nodelist.cpp:281
unsigned Num_Nodes(void) const
Definition nodelist.h:75
void Sort(const INodeCompareClass &node_compare)
Definition nodelist.cpp:346
void Insert(INodeListClass &insertlist)
Definition nodelist.cpp:238
Definition nodelist.cpp:62