Exemplo n.º 1
0
        public ExportMeshRequestManager(BackendRouter backend, ElementMeshReader meshReader)
        {
            _backend    = backend;
            _meshReader = meshReader;

            const int defaultCapacity = 1000;

            _elementIdExportQueue         = new string[defaultCapacity];
            _elementIdExportQueuePosition = 0;
            _elementIdExportQueueCount    = 0;
            _filteredElementIdBuffer      = new string[defaultCapacity];
            _filteredElementIdCount       = 0;
            _alreadyRequestedElements     = new Dictionary <string, bool>(defaultCapacity);

            // Fill cached RequestWrapper with dummy entries so we can replace entries by index
            _cachedRequestWrapper = new RequestWrapper {
                ExportMeshesRequest = new ExportMeshesRequest {
                    ChordTol = ChordTol
                }
            };
            RepeatedField <string> elementIds = _cachedRequestWrapper.ExportMeshesRequest.ElementIds;

            for (int i = 0; i < BatchSize; ++i)
            {
                elementIds.Add("");
            }
        }
        public SavedViews(Camera camera, CoordinateUtility coordinateUtility, BackendRouter backend)
        {
            _camera            = camera;
            _coordinateUtility = coordinateUtility;
            _backend           = backend;

            _entries = new List <Entry>();
        }
        public DesktopUserInput(Material opaqueMaterial, BackendRouter backend, SavedViews savedViews)
        {
            _backend           = backend;
            _selectionMaterial = new Material(opaqueMaterial)
            {
                color = Color.magenta
            };
            _savedViews = savedViews;

            _camera          = Camera.main;
            _cameraTransform = _camera.transform;
        }
        public GraphicsStreaming(BackendRouter backend, ExportMeshRequestManager meshRequestManager,
                                 CoordinateUtility coordinateUtility)
        {
            _backend            = backend;
            _meshRequestManager = meshRequestManager;
            _coordinateUtility  = coordinateUtility;

            _camera          = Camera.main;
            _cameraTransform = _camera.transform;

            _forceRequest = true; // force initial request
        }
Exemplo n.º 5
0
        private void Start()
        {
            Physics.queriesHitBackfaces = true;

            // Address must match ProtobufRpcServer.ts
            _backend = new BackendRouter("ws://localhost:3005", () =>
            {
                _isBackendSetup = true;
                _coordinateUtility.CalculateOffsetFromProjectExtents();
                _savedViews.RequestViewsFromBackend();
            });
            _coordinateUtility = new CoordinateUtility(_backend);
            _savedViews        = new SavedViews(Camera.main, _coordinateUtility, _backend);
            _userInput         = new DesktopUserInput(OpaqueMaterial, _backend, _savedViews);

            _meshReader         = new ElementMeshReader(_coordinateUtility);
            _meshRequestManager = new ExportMeshRequestManager(_backend, _meshReader);
            _graphicsStreaming  = new GraphicsStreaming(_backend, _meshRequestManager, _coordinateUtility);

            _textureCache = new TextureCache(_backend);
            _meshHandler  = new ElementGameObjectCreator(OpaqueMaterial, TransparentMaterial, _textureCache);
        }
 public TextureCache(BackendRouter backend)
 {
     _backend = backend;
 }
Exemplo n.º 7
0
 public CoordinateUtility(BackendRouter backend)
 {
     _backend = backend;
 }