-
Notifications
You must be signed in to change notification settings - Fork 2
/
CSGOperations.h
62 lines (57 loc) · 2.33 KB
/
CSGOperations.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* Copyright 2014 ROBLOX Corporation, All Rights Reserved */
#pragma once
#include "rbx/boost.hpp"
#include <boost/unordered_map.hpp>
#include <vector>
#include "util/Extents.h"
#include "v8tree/Instance.h"
namespace RBX
{
class DataModel;
class PartInstance;
class PartOperation;
class NegateOperation;
class CSGMesh;
typedef void (*MessageCallback)( const char* title, const char* msg );
class CSGOperations
{
public:
CSGOperations( DataModel* pDatamodel, MessageCallback failedFun );
bool doUnion(
Instances::const_iterator start,
Instances::const_iterator end,
boost::shared_ptr<PartOperation>& partOperation );
bool doNegate(
Instances::const_iterator start,
Instances::const_iterator end,
Instances& toSelect );
bool doSeparate(
Instances::const_iterator start,
Instances::const_iterator end,
Instances& ungroupedItems );
private:
DataModel* mDatamodel;
MessageCallback operationFailed;
bool setUnionMesh(boost::shared_ptr<PartOperation> finalPartOperation,
Instances::const_iterator start,
Instances::const_iterator end,
bool isChildRecalculation);
bool setNegateMesh(shared_ptr<NegateOperation> negateOperation, shared_ptr<Instance> instance );
bool recalculateMesh(shared_ptr<PartOperation> partOperation);
bool negateSelection(Instances& toRemove,
Instances& toSelect,
Instances::const_iterator start,
Instances::const_iterator end);
bool separate(const shared_ptr<Instance>& wInstance,
Instances& separatedItems,
Instances& itemsToDelete);
bool setOperationMesh(shared_ptr<PartOperation> partOperation, Instances instances);
bool createPartMesh(PartInstance* part, CSGMesh* modelData);
void resetInstanceCFrame(Instances::const_iterator start,
Instances::const_iterator end,
boost::unordered_map<boost::shared_ptr<Instance>, CoordinateFrame> originalCFrames);
void warnIfChildInstances(shared_ptr<PartInstance> partInstance, const std::string& operationType);
Instance* getCommonParentOrWorkspace(Instances::const_iterator start, Instances::const_iterator end);
static const char* unionFailedMsg;
};
}