HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_PackedFolders.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GU_PackedFolders.h (GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_PackedFolders__
12 #define __GU_PackedFolders__
13 
14 #include "GU_API.h"
15 #include "GU_DetailHandle.h"
16 #include "GU_PrimPacked.h"
17 #include <UT/UT_ArrayStringMap.h>
18 #include <UT/UT_ArrayStringSet.h>
19 #include <UT/UT_PathPattern.h>
20 #include <UT/UT_StringHolder.h>
21 #include <UT/UT_StringMap.h>
22 #include <variant>
23 
24 class GU_PackedFolders;
25 
26 /// Read-Only Packed Folder Structure
28 {
29 public:
30  /// Class representing a file in the file map
31  class FileInfo
32  {
33  public:
34 
35  /// Path that this file represents
36  const UT_StringHolder &path() const { return myPath; };
37 
38  /// The parent can be in one of three states
39  /// @{
40  bool isParentEmpty() const
41  {
42  return std::holds_alternative<std::monostate>(myParentPrim);
43  }
44  bool isParentPrim() const
45  {
46  return std::holds_alternative<const GU_PrimPacked *>(myParentPrim);
47  }
48  bool isParentRange() const
49  {
50  return std::holds_alternative<GA_Range>(myParentPrim);
51  }
52  /// @}
53 
54  /// Obtain parent as a GU_PrimPacked*, throws if !isParentPrim()
55  /// @{
56  const GU_PrimPacked *parentPrim() const
57  {
58  UT_ASSERT(isParentPrim());
59  return std::get<const GU_PrimPacked *>(myParentPrim);
60  }
61  /// @}
62 
63  /// Get parent as a packed primitive, returns nullptr if not a prim
64  /// @{
66  {
67  if (!isParentPrim())
68  return nullptr;
69  return parentPrim();
70  }
71  /// @}
72 
73  /// Get parent as a GA_Range, throws if !isParentRange()
74  /// @{
75  const GA_Range &parentRange() const
76  {
77  UT_ASSERT(isParentRange());
78  return std::get<GA_Range>(myParentPrim);
79  }
80  /// @}
81 
82  /// Return true if parent is a packed primitive and has treatasfolder
83  /// intrinsic enabled
84  bool treatAsFolder() const;
85 
86  /// Return true if we're the root or treatAsFolder()
87  bool isFolder() const
88  {
89  return (myPath == "/" || treatAsFolder());
90  }
91 
92  /// Accessor to GU_DetailHandle of file contents
93  /// @{
94  const GU_ConstDetailHandle &primGdh() const { return myPrimGdh; }
95  /// @}
96 
97  /// Flag accessors
98  /// @{
99  bool isExisting() const { return myExisting; }
100  void setExisting(bool f) { myExisting = f; }
101 
102  bool isModified() const { return myModified; }
103  void setModified(bool f) { myModified = f; }
104 
105  bool isTouched() const { return myTouched; }
106  void setTouched(bool f) { myTouched = f; }
107 
108  bool isCleared() const { return myCleared; }
109  void setCleared(bool f) { myCleared = f; }
110 
111  bool isVisible() const { return myVisible; }
112  void setVisible(bool f) { myVisible = f; }
113  /// @}
114 
115  private:
116  friend class GU_PackedFoldersRO;
117 
118  UT_StringHolder myPath;
119 
120  // myParentPrim is initially monostate.
121  // When myParent is a GU_PrimPacked*/GA_Range, these are primitives
122  // inside its parent's FileInfo::myPrimGdh.
123  std::variant<std::monostate, const GU_PrimPacked *, GA_Range> myParentPrim;
124 
125  // Geometry contents of this file
126  GU_ConstDetailHandle myPrimGdh;
127 
128  bool myExisting = false;
129  bool myModified = false;
130  bool myTouched = false;
131  bool myCleared = false;
132  bool myVisible = true;
133  };
134 
135  /// Construct a folder structure with its own detail
137 
138  /// Construct and build the map over the given detail, holding references
139  /// to it
141  {
142  replaceDetail(d);
143  }
144 
145  /// Construct and build the map over the given detail, holding references
146  /// to it
148  {
150  }
151 
152  ~GU_PackedFoldersRO() = default;
153 
154  /// Copy geometry and hierarchy from another GU_PackedFoldersRO
155  /// @{
158  {
159  *this = src;
160  }
162  /// @}
163 
164  /// Rebuild file map over the given detail, holding references to it
165  void replaceDetail(const GU_DetailHandle &d);
166 
167  /// Check if file at given path is a folder; returns false if file does not
168  /// exist
169  bool isFolder(const UT_StringRef &path) const;
170 
171  /// Get file access for read; returns nullptr if file does not exist
172  /// Note: GU_PackedFolders::FileInfo* can become invalid when rebuildMap() is called.
174 
175  /// Fill array with the children of this file at path, if it exists
176  /// Note: GU_PackedFolders::FileInfo* can become invalid when rebuildMap() is called.
178  const UT_StringRef &path) const;
179 
180  /// Fill array with files which path the given apex syntax pattern; returns
181  /// false on bad pattern_str
182  /// @param sorted Sorts the output list by file path. If disabled, the list
183  /// is in an arbitrary order.
184  /// Note: GU_PackedFolders::FileInfo* can become invalid when rebuildMap() is called.
185  bool findFilesByPattern(
187  const UT_StringRef &pattern_str,
188  bool sorted,
189  UT_StringHolder &error) const;
190 
191  /// Verifies packed primitive implementation pointers. Only does something
192  /// on Windows debug builds.
193  bool verify() const;
194 
195  /// Returns a string representing the topology of the whole
197 
198  /// Returns a string representing the topology of the whole folder structure
199  /// but without actually building the GU_PackedFolders.
200  static UT_StringHolder getTopoFormat(const GU_ConstDetailHandle &root_h);
201 
202 private:
203  FileInfo &rootFileInfo();
204  const FileInfo &rootFileInfo() const;
205 
206  /// Rebuild the file map from myDetail if it was changed externally.
207  void rebuildMap(const GU_ConstDetailHandle &detail);
208 
209  static void rebuildMap( const GU_ConstDetailHandle &detail,
210  UT_ArrayStringMap<FileInfo> &file_map, bool create_details);
211 
212 private:
213  UT_ArrayStringMap<FileInfo> myFileMap;
214 
215  friend GU_PackedFolders;
216 };
217 
218 /// Packed Folder Structure
220 {
221 public:
222  /// Class representing a file in the file map
223  class FileInfo
224  {
225  public:
226 
227  /// Path that this file represents
228  const UT_StringHolder &path() const { return myPath; };
229 
230  /// The parent can be in one of three states
231  /// @{
232  bool isParentEmpty() const
233  {
234  return std::holds_alternative<std::monostate>(myParentPrim);
235  }
236  bool isParentPrim() const
237  {
238  return std::holds_alternative<GU_PrimPacked *>(myParentPrim);
239  }
240  bool isParentRange() const
241  {
242  return std::holds_alternative<GA_Range>(myParentPrim);
243  }
244  /// @}
245 
246  /// Obtain parent as a GU_PrimPacked*, throws if !isParentPrim()
247  /// @{
249  {
250  UT_ASSERT(isParentPrim());
251  return std::get<GU_PrimPacked *>(myParentPrim);
252  }
253  const GU_PrimPacked *parentPrim() const
254  {
255  UT_ASSERT(isParentPrim());
256  return std::get<GU_PrimPacked *>(myParentPrim);
257  }
258  /// @}
259 
260  /// Get parent as a packed primitive, returns nullptr if not a prim
261  /// @{
263  {
264  auto *pp_prim = std::get_if<GU_PrimPacked *>(&myParentPrim);
265  return pp_prim ? *pp_prim : nullptr;
266  }
268  {
269  auto *pp_prim = std::get_if<GU_PrimPacked *>(&myParentPrim);
270  return pp_prim ? *pp_prim : nullptr;
271  }
272  /// @}
273 
274  /// Get parent as a GA_Range, throws if !isParentRange()
275  /// @{
277  {
278  UT_ASSERT(isParentRange());
279  return std::get<GA_Range>(myParentPrim);
280  }
281  const GA_Range &parentRange() const
282  {
283  UT_ASSERT(isParentRange());
284  return std::get<GA_Range>(myParentPrim);
285  }
286  /// @}
287 
288  /// Return true if parent is a packed primitive and has treatasfolder
289  /// intrinsic enabled
290  bool treatAsFolder() const
291  {
292  const GU_PrimPacked *prim = getIfParentPrim();
293  return prim && GU_PackedFolders::treatAsFolder(prim);
294  }
295 
296  /// Return true if we're the root or treatAsFolder()
297  bool isFolder() const
298  {
299  return myPath == "/" || treatAsFolder();
300  }
301 
302  /// Safe accessors to GU_ConstDetailHandle/GU_DetailHandle of file contents
303  /// @{
305  {
306  return primGdh().castAwayConst();
307  }
308 
309 
311  {
312  if (myPrimGdh.isValid())
313  {
314  return myPrimGdh;
315  }
316 
317  GU_DetailHandle new_gdh;
318  new_gdh.allocateAndSet(new GU_Detail);
319  if (getIfParentPrim())
320  {
321  parentPrim()->unpack(*new_gdh.gdpNC());
322  }
323 
324  myPrimGdh = new_gdh;
325  return myPrimGdh;
326  }
327 
328  void setPrimGdh(const GU_ConstDetailHandle &prim_gdh) { myPrimGdh = prim_gdh; }
329  /// @}
330 
331  /// Flag accessors
332  /// @{
333  bool isExisting() const { return myExisting; }
334  void setExisting(bool f) { myExisting = f; }
335 
336  bool isModified() const { return myModified; }
337  void setModified(bool f) { myModified = f; }
338 
339  bool isTouched() const { return myTouched; }
340  void setTouched(bool f) { myTouched = f; }
341 
342  bool isCleared() const { return myCleared; }
343  void setCleared(bool f) { myCleared = f; }
344 
345  bool isVisible() const { return myVisible; }
346  void setVisible(bool f) { myVisible = f; }
347  /// @}
348 
349  private:
350  friend class GU_PackedFolders;
351 
352  UT_StringHolder myPath;
353 
354  // myParentPrim is initially monostate.
355  // When myParent is a GU_PrimPacked*/GA_Range, these are primitives
356  // inside its parent's FileInfo::myPrimGdh.
357  std::variant<std::monostate, GU_PrimPacked *, GA_Range> myParentPrim;
358 
359  // Geometry contents of this file
360  mutable GU_ConstDetailHandle myPrimGdh;
361 
362  bool myExisting = false;
363  bool myModified = false;
364  bool myTouched = false;
365  bool myCleared = false;
366  bool myVisible = true;
367  };
368 
369  /// Construct a folder structure with its own detail
371 
372  /// Construct and build the map over the given detail, holding references
373  /// to it
374  /// @mark_existing Sets the Existing flag on existing paths. This affects
375  /// the removeStale() behavior.
376  /// Use mark_existing=true if you want to keep existing details as is and
377  /// only modify the touched paths.
378  /// Use mark_existing=false if you want to delete existing details that
379  /// aren't touched
380  explicit GU_PackedFolders(GU_DetailHandle &d,
381  bool reuse_detail_ids=false,
382  bool mark_existing=true
383  );
384 
385  ~GU_PackedFolders() = default;
386 
387  /// Copy geometry and hierarchy from another GU_PackedFolders
388  /// @{
390  : GU_PackedFolders()
391  {
392  *this = src;
393  }
395  /// @}
396 
397  /// Get and set treatasfolder intrinsic on a packed prim
398  static bool treatAsFolder(const GU_PrimPacked *pack);
399  static void setTreatAsFolder(GU_PrimPacked *pack, bool b);
400 
401  /// Return whether the given primitive is in _3d_hidden_primitives
402  static bool isPrimVisible(const GA_Primitive *prim);
403 
404  /// Path and name processing functions
405  /// @{
408  static void splitFileName(const UT_StringRef &label, UT_WorkBuffer &name,
410  static void splitFilePath(const UT_StringRef &path, UT_Array<UT_StringHolder> &file_names);
411  /// @}
412 
413  /// Return packed prim if the detail is a single, packed object; return
414  /// null if not
415  static const GU_PrimPacked *getPackedFromDetail(const GU_Detail *gdp);
416 
417  /// Updates the packed geometry at the given path. If no geometry exists
418  /// at the given path, the geometry will not be added.
419  /// Returns whether the geometry was successfully updated.
420  static bool updatePackedGeometry(GU_DetailHandle packed_gdh,
422  const UT_StringRef &path);
423 
424  /// Returns whether the geometry contains a packed folder geometry with the
425  /// given path.
426  /// @{
427  static bool contains(GU_ConstDetailHandle gdh,
428  const UT_StringRef &path,
429  GA_OffsetArray *offsets=nullptr);
430  static bool contains(GU_ConstDetailHandle gdh,
431  const UT_Array<UT_StringHolder> &file_names,
432  GA_OffsetArray *offsets=nullptr);
433  /// @}
434 
435  /// Helper method to set the properties on an existing file
436  /// Note: GU_PackedFolders::FileInfo* can become invalid after calling
437  /// setFileProperties(). You'll have to call the find() methods again.
438  bool setFileProperties(const UT_StringRef &path, bool treat_as_folder, bool visible);
439 
440  /// Rebuild file map over the given detail, holding references to it
442 
443  /// Update the chain of packed primitives up the path to the root detail
444  void updatePath(const UT_StringRef &path_str);
445 
446  /// Build a path of folders if it does not exist already.
447  /// Returns true if successful; fails if a file in path_str exists and is
448  /// not a folder
449  bool buildPath(const UT_StringRef &path_str);
450 
451  /// Insert/replace a file at the given path, creating the path if it does
452  /// not exist. If pack is true, pack d before adding to the folder.
453  /// If is_folder is true, set the treatasfolder intrinsic on the inserted
454  /// file.
455  /// Returns true if successful; fails if it can't create the path to the
456  /// file
457  /// Note: GU_PackedFolders::FileInfo* can become invalid after call insert()
458  /// You'll have to call the find() methods again.
459  bool insert(
460  const UT_StringRef &path,
461  const GU_ConstDetailHandle &d,
462  bool pack = true,
463  bool is_folder = false,
464  bool is_visible = true);
465 
466  /// Remove a file or folder at the given path.
467  /// Returns true if successful; fails if the given path is the root "/" or
468  /// doesn't exist.
469  bool remove(const UT_StringRef &path_str);
470 
471  /// Merges the contents of 'src_folders' into this folder structure,
472  /// filtered by the specified file pattern.
473  /// Note: GU_PackedFolders::FileInfo* can become invalid after call insert()
474  /// You'll have to call the find() methods again.
475  void merge(
476  const GU_PackedFoldersRO &src_folders,
477  const UT_StringRef &pattern);
478 
479  /// Simple struct holding the args for the remove and insert operations.
480  struct EditInfo
481  {
482  bool myRemove = false; // true to remove, false to insert.
483  UT_StringHolder myPath; // The path to insert or remove
484 
485  // Extra args for Insert
486  GU_ConstDetailHandle myDetail; // Detail to insert.
487  bool myPack = true; // insert pack
488  bool myIsFolder = false; //insert is_folder
489  bool myIsVisible = true; // insert is_visibled
490 
491  bool myRet = false; // Return code for the operation.
492  };
493 
494  /// Accumulate edit operations in a block.
496  {
497  public:
498  /// Insert a detail at the given path.
499  void insert(
500  const UT_StringRef &path,
501  const GU_ConstDetailHandle &d,
502  bool pack = true,
503  bool is_folder = false,
504  bool is_visible = true)
505  {
506  EditInfo o;
507  o.myRemove = false;
508  o.myPath = path;
509  o.myDetail = d;
510  o.myPack = pack;
511  o.myIsFolder = is_folder;
512  o.myIsVisible = is_visible;
513  myOps.append(o);
514  }
515 
516  /// Remove a path
517  void remove(const UT_StringRef &path)
518  {
519  EditInfo o;
520  o.myRemove = true;
521  o.myPath = path;
522  myOps.append(o);
523  }
524 
525  /// Remove a FileInfo
526  void remove(const FileInfo *fi)
527  {
528  EditInfo o;
529  o.myRemove = true;
530  o.myPath = fi->path();
531  myOps.append(o);
532  }
533 
534  /// Move a FileInfo to a new path. Does an insert and remove.
535  void move(const FileInfo *fi, const UT_StringRef &new_path, bool pack)
536  {
537  EditInfo i;
538  i.myRemove = false;
539  i.myPath = new_path;
540  i.myDetail = fi->primGdh();
541  i.myPack = pack;
542  i.myIsFolder = fi->isFolder();
543  i.myIsVisible = fi->isVisible();
544  myOps.append(i);
545 
546  EditInfo r;
547  r.myRemove = true;
548  r.myPath = fi->path();
549  myOps.append(r);
550  }
551 
553  };
554  /// Perform multiple insert/remove/move operations in a single step.
555  /// Returns true if all the operations succeeded.
556  /// o.myOps[i].myRet has the return status of individual edit operations.
557  /// Note: GU_PackedFolders::FileInfo* can become invalid when rebuildMap()
558  /// is called and it is likely to happen after doing many operations.
559  /// You'll have to call the find() methods again.
560  bool edit(EditOperations &o);
561 
562 
563  /// Set flags to true on a given file and if desired, its children
564  void setFlags(
565  const UT_StringRef &path,
566  bool existing,
567  bool modified,
568  bool touched,
569  bool and_children = false);
570 
571  /// Clear flags to false on a given file and if desired, its children
572  void clearFlags(
573  const UT_StringRef &path,
574  bool existing,
575  bool modified,
576  bool touched,
577  bool and_children = false);
578 
579  /// Sets touch flag on a given file & its children if and_children is true
580  void touch(const UT_StringRef &path, bool and_children = false);
581 
582  /// Mark all folders in the path given as touched
583  void touchFolders(const UT_StringRef &path_str);
584 
585  /// Removes stale files which are flagged as untouched.
586  /// Files flagged existing if found by replaceDetail()/rebuildMap() are
587  /// protected. If backup is provided, files which are untouched, modified,
588  /// and existing will be replaced by the copy in backup. Files are marked
589  /// modified if created/replaced by insert().
590  void removeStale(const GU_PackedFolders *backup = nullptr);
591 
592  /// Check if file at given path is a folder; returns false if file does not
593  /// exist
594  bool isFolder(const UT_StringRef &path) const;
595 
596  /// Get file access for read; returns nullptr if file does not exist
597  /// Note: GU_PackedFolders::FileInfo* can become invalid when rebuildMap() is called.
598  /// It can happen when calling insert() or setFileProperties()
599  const GU_PackedFolders::FileInfo *findFile(const UT_StringRef &path) const;
600 
601  /// Fill array with the children of this file at path, if it exists
602  /// Note: GU_PackedFolders::FileInfo* can become invalid when rebuildMap() is called.
603  /// It can happen when calling insert() or setFileProperties()
604  void findChildren(UT_Array<const GU_PackedFolders::FileInfo *> &out,
605  const UT_StringRef &path) const;
606 
607  /// Fill array with files which path the given apex syntax pattern; returns
608  /// false on bad pattern_str
609  /// @param sorted Sorts the output list by file path. If disabled, the list
610  /// is in an arbitrary order.
611  /// Note: GU_PackedFolders::FileInfo* can become invalid when rebuildMap() is called.
612  /// It can happen when calling insert() or setFileProperties()
613  bool findFilesByPattern(
615  const UT_StringRef &pattern_str,
616  bool sorted,
617  UT_StringHolder &error) const;
618 
619  /// Verifies packed primitive implementation pointers. Only does something
620  /// on Windows debug builds.
621  bool verify() const;
622 
623  /// Returns a string representing the topology of the whole
624  UT_StringHolder getTopoFormat() const;
625 
626 private:
627  FileInfo &rootFileInfo();
628  const FileInfo &rootFileInfo() const;
629 
630  /// Rebuild the file map from myDetail if it was changed externally.
631  /// It will clear children of the given path before rebuilding.
632  /// If path does not exist in the map, it will fail silently.
633  /// If mark_existing, myExisting flag will be set on files.
634  ///
635  /// This can corrupt GU_PackedFolders::FileInfo* returned by
636  // findFile(), findChildren(), findFilesByPattern()
637  void rebuildMap(GU_DetailHandle *detail, const UT_StringRef &path,
638  bool mark_existing = true, bool reuse_detail_ids=false);
639 
640  /// internal insert call that accumulates the paths to rebuild.
641  bool insert(
642  const UT_StringRef &path,
643  const GU_ConstDetailHandle &d,
644  UT_StringArray &rebuild_paths,
645  bool pack = true,
646  bool is_folder = false,
647  bool is_visible = true);
648 
649 private:
650  UT_ArrayStringMap<FileInfo> myFileMap;
651 };
652 
654 bool
656 {
657  const GU_PrimPacked *prim = getIfParentPrim();
658  return prim && GU_PackedFolders::treatAsFolder(prim);
659 }
660 
661 namespace UT
662 {
663 template <typename T>
664 struct DefaultClearer;
665 
666 template <>
668 {
669  static void clear(GU_PackedFoldersRO::FileInfo &v) { v.setCleared(true); }
671  {
672  return v.isCleared();
673  }
675  {
676  new ((void *)p) GU_PackedFoldersRO::FileInfo();
677  }
678  static const bool clearNeedsDestruction = true;
679 };
680 
681 template <>
683 {
684  static void clear(GU_PackedFolders::FileInfo &v) { v.setCleared(true); }
686  {
687  return v.isCleared();
688  }
690  {
691  new ((void *)p) GU_PackedFolders::FileInfo();
692  }
693  static const bool clearNeedsDestruction = true;
694 };
695 } // namespace UT
696 
697 #endif
bool isFolder(const UT_StringRef &path) const
static bool treatAsFolder(const GU_PrimPacked *pack)
Get and set treatasfolder intrinsic on a packed prim.
static void setTreatAsFolder(GU_PrimPacked *pack, bool b)
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2545
GU_PackedFoldersRO(const GU_PackedFoldersRO &src)
GU_ConstDetailHandle myDetail
const GU_ConstDetailHandle & primGdh() const
~GU_PackedFolders()=default
static void splitFilePath(const UT_StringRef &path, UT_Array< UT_StringHolder > &file_names)
const GLdouble * v
Definition: glcorearb.h:837
GU_DetailHandle castAwayConst() const
Accumulate edit operations in a block.
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
GU_PrimPacked * getIfParentPrim()
Simple struct holding the args for the remove and insert operations.
const GU_PrimPacked * getIfParentPrim() const
void replaceDetail(const GU_DetailHandle &d)
Rebuild file map over the given detail, holding references to it.
const GA_Range & parentRange() const
GU_PackedFolders(const GU_PackedFolders &src)
static void clear(GU_PackedFolders::FileInfo &v)
Read-Only Packed Folder Structure.
void updatePath(const UT_StringRef &path_str)
Update the chain of packed primitives up the path to the root detail.
UT_StringHolder getTopoFormat() const
Returns a string representing the topology of the whole.
void move(const FileInfo *fi, const UT_StringRef &new_path, bool pack)
Move a FileInfo to a new path. Does an insert and remove.
bool buildPath(const UT_StringRef &path_str)
OIIO_FORCEINLINE vbool4 insert(const vbool4 &a, bool val)
Helper: substitute val for a[i].
Definition: simd.h:3556
static bool isPrimVisible(const GA_Primitive *prim)
Return whether the given primitive is in _3d_hidden_primitives.
Class representing a file in the file map.
const UT_StringHolder & path() const
Path that this file represents.
bool setFileProperties(const UT_StringRef &path, bool treat_as_folder, bool visible)
void setPrimGdh(const GU_ConstDetailHandle &prim_gdh)
static void clearConstruct(GU_PackedFoldersRO::FileInfo *p)
A range of elements in an index-map.
Definition: GA_Range.h:42
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
< returns > If no error
Definition: snippets.dox:2
static void splitFileName(const UT_StringRef &label, UT_WorkBuffer &name, UT_WorkBuffer &type)
void allocateAndSet(GU_Detail *gdp, bool own=true)
GLfloat f
Definition: glcorearb.h:1926
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
static bool updatePackedGeometry(GU_DetailHandle packed_gdh, GU_ConstDetailHandle gdh, const UT_StringRef &path)
GU_DetailHandle safePrimGdhNC()
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
void insert(const UT_StringRef &path, const GU_ConstDetailHandle &d, bool pack=true, bool is_folder=false, bool is_visible=true)
Insert a detail at the given path.
static void clearConstruct(GU_PackedFolders::FileInfo *p)
GU_ConstDetailHandle primGdh() const
Packed Folder Structure.
bool findFilesByPattern(UT_Array< const GU_PackedFoldersRO::FileInfo * > &out, const UT_StringRef &pattern_str, bool sorted, UT_StringHolder &error) const
const UT_StringHolder & path() const
Path that this file represents.
static void clear(GU_PackedFoldersRO::FileInfo &v)
void replaceDetail(GU_DetailHandle &d)
Rebuild file map over the given detail, holding references to it.
#define GU_API
Definition: GU_API.h:14
GLuint const GLchar * name
Definition: glcorearb.h:786
GLushort pattern
Definition: glad.h:2583
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
GU_PackedFoldersRO(const GU_ConstDetailHandle &d)
bool isFolder() const
Return true if we're the root or treatAsFolder()
GU_Detail * gdpNC()
static const GU_PrimPacked * getPackedFromDetail(const GU_Detail *gdp)
Class representing a file in the file map.
const GA_Range & parentRange() const
GU_PackedFoldersRO()
Construct a folder structure with its own detail.
const GU_PackedFoldersRO::FileInfo * findFile(const UT_StringRef &path) const
static void splitFirstDirectory(UT_WorkBuffer &path, UT_WorkBuffer &out)
GU_PrimPacked * parentPrim()
const GU_PrimPacked * parentPrim() const
LeafData & operator=(const LeafData &)=delete
void findChildren(UT_Array< const GU_PackedFoldersRO::FileInfo * > &out, const UT_StringRef &path) const
static void splitLastDirectory(UT_WorkBuffer &path, UT_WorkBuffer &out)
const GU_PrimPacked * getIfParentPrim() const
GU_PackedFoldersRO(const GU_DetailHandle &d)
const GU_PrimPacked * parentPrim() const
~GU_PackedFoldersRO()=default
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
bool isFolder() const
Return true if we're the root or treatAsFolder()
bool verify() const
OutGridT XformOp bool bool MergePolicy merge
GLboolean r
Definition: glcorearb.h:1222
GU_PackedFolders()
Construct a folder structure with its own detail.
bool OIIO_UTIL_API contains(string_view a, string_view b)
Does 'a' contain the string 'b' within it?
static bool isClear(const GU_PackedFolders::FileInfo &v)
GLenum src
Definition: glcorearb.h:1793
static bool isClear(const GU_PackedFoldersRO::FileInfo &v)