HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_Prune.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Side Effects Software Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef __HUSD_Prune_h__
19 #define __HUSD_Prune_h__
20 
21 #include "HUSD_API.h"
22 #include "HUSD_DataHandle.h"
23 #include "HUSD_Path.h"
24 #include "HUSD_PathSet.h"
25 #include "HUSD_Utils.h"
26 #include <UT/UT_StringArray.h>
27 #include <UT/UT_StringMap.h>
28 #include <SYS/SYS_Types.h>
29 
30 class HUSD_FindPrims;
31 class HUSD_TimeCode;
32 template <typename T> class UT_Array;
33 
35 {
36 public:
38  ~HUSD_Prune();
39 
41  {
43  MakeInvisible
44  };
45 
46  static bool calculatePruneSet(const HUSD_FindPrims &findprims,
47  const HUSD_FindPrims *excludeprims,
48  const HUSD_FindPrims *limitpruneprims,
49  bool prune_unselected,
50  HUSD_PathSet &paths);
51 
52  bool pruneCalculatedSet(HUSD_PathSet &paths,
53  const HUSD_TimeCode &timecode,
54  HUSD_Prune::PruneMethod prune_method,
55  bool prune,
56  bool prune_ancestors_automatically,
57  bool prune_point_instances_separately,
58  UT_StringArray *pruned_prims) const;
59 
60  bool prunePointInstances(
61  const UT_StringMap<UT_Array<int64>> &ptinstmap,
62  const HUSD_TimeCode &timecode,
63  const UT_StringMap<bool> &pruneprimmap,
64  bool prune_unselected) const;
65 
66  bool getIsTimeVarying() const;
67 
68  void setCreateMissingPrimsAsOvers(bool create);
69 
70  bool getCreateMissingPrimsAsOvers() const;
71 
72 private:
73  HUSD_AutoWriteLock &myWriteLock;
74  bool myCreateMissingPrimsAsOvers;
75  mutable HUSD_TimeSampling myTimeSampling;
76 };
77 
78 #endif
79 
#define HUSD_API
Definition: HUSD_API.h:32
HUSD_TimeSampling
Definition: HUSD_Utils.h:99
void prune(TreeT &tree, typename TreeT::ValueType tolerance=zeroVal< typename TreeT::ValueType >(), bool threaded=true, size_t grainSize=1)
Reduce the memory footprint of a tree by replacing with tiles any nodes whose values are all the same...
Definition: Prune.h:335