pathname.h

Go to the documentation of this file.
00001 /*  
00002  *      PathName.h - PathName class for MAXScript
00003  *
00004  *          Copyright (c) John Wainwright 1996
00005  *
00006  */
00007 
00008 #pragma once
00009 
00010 #include "..\foundation\streams.h"
00011 #include "objectsets.h"
00012 
00013 enum path_flags { rooted_path = 1, wild_card_path = 2 };
00014 
00015 visible_class_debug_ok (PathName)
00016 
00017 class PathName : public Set
00018 {
00019 public:
00020     int         flags;
00021     short       n_levels;
00022     MCHAR**     path_levels;
00023     Thunk*      root_set_thunk;
00024     Value*      root_set;
00025 
00026                 PathName();
00027                 ~PathName();
00028 #   define      is_pathname(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(PathName))
00029 
00030                 classof_methods (PathName, Set);
00031     void        collect() { delete this; }
00032     ScripterExport void     sprin1(CharStream* s);
00033 
00034     ScripterExport Value* eval();
00035     void        append(MCHAR* level_name);
00036     Value*      find_object(MCHAR* name);
00037     Value*      get_object();
00038 
00039     ScripterExport Value* map(node_map& m);
00040 
00041 #include "..\macros\define_implementations.h"
00042     def_generic  (get,      "get");   // indexed get (no put or append)
00043     def_property ( count );
00044     def_property ( center );
00045     def_property ( min );
00046     def_property ( max );
00047 };
00048 
00049 extern MCHAR* ellipsis_level_name;
00050 extern MCHAR* parent_level_name;
00051 
00052 // Added: 12/17/03
00053 // This class provides an interface to a derived implementation class that caches scene node names
00054 // based on the node name resolution scheme used by MAXScript. There is a single, static instance 
00055 // of the derived class.
00056 // usage: SceneNodeByNameCache::GetInst().GetSceneNodeByName(theName,true,false);
00057 class SceneNodeByNameCache
00058 {
00059 public:
00060     ScripterExport virtual ~SceneNodeByNameCache();
00061     // get the singleton instance of SceneNodeByNameCache
00062     ScripterExport static SceneNodeByNameCache& GetInst();
00063     // get the INode* given the name. If exactMatch is false, use inexact (MXS) name matching. Can return NULL
00064     ScripterExport virtual INode *GetSceneNodeByName(const MCHAR* name, bool exactMatch = false, bool caseSensitive = false) = 0;
00065 };
00066