/// <summary>
 /// Returns a list of WorkItems
 /// </summary>
 /// <returns></returns>
 public IEnumerable<ICloudWorkItem> ListWorkItems(DetailLevel detailLevel = null)
 {
     using (IWorkItemManager wiManager = this.Client.OpenWorkItemManager())
     {
         return wiManager.ListWorkItems(detailLevel);
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="YumlModelDiagramProvider" /> class.
        /// </summary>
        /// <param name="models">The models.</param>
        /// <param name="detailLevels">The detail levels.</param>
        public YumlModelDiagramProvider(IEnumerable<Type> models, DetailLevel[] detailLevels)
        {
            this.Models = models;

            // Configure generator
            this.yumlFactory = this.GetYumlFactory(this.Models);

            // Get image path
            this.Image = this.yumlFactory.GenerateClassDiagramUri(detailLevels);
        }
Ejemplo n.º 3
0
 internal AsyncListTasksEnumerator(
     JobOperations jobOperations,
     string jobId,
     BehaviorManager behaviorMgr,
     DetailLevel detailLevel)
 {
     this._jobOperations = jobOperations;
     this._jobId         = jobId;
     this._behaviorMgr   = behaviorMgr;
     this._detailLevel   = detailLevel;
 }
Ejemplo n.º 4
0
 internal AsyncListComputeNodesEnumerator(
     PoolOperations parentPoolOps,
     string poolId,
     BehaviorManager behaviorMgr,
     DetailLevel detailLevel)
 {
     _parentPoolOps = parentPoolOps;
     _poolId        = poolId;
     _behaviorMgr   = behaviorMgr;
     _detailLevel   = detailLevel;
 }
Ejemplo n.º 5
0
 public SimulationVisualMovable2D(
     IMovableObjectInfo moveableObject,
     DetailLevel detailLevel,
     Transformation2D transformer,
     double strokeThickness,
     MouseButtonEventHandler elementClickAction,
     SimulationAnimation2D controller)
     : base(detailLevel, transformer, strokeThickness, elementClickAction, controller)
 {
     _moveableObject = moveableObject;
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Enumerates the files in the <see cref="CloudTask"/>'s directory on its compute node.
        /// </summary>
        /// <param name="recursive">If true, performs a recursive list of all files of the task. If false, returns only the files in the root task directory.</param>
        /// <param name="detailLevel">A <see cref="DetailLevel"/> used for filtering the list and for controlling which properties are retrieved from the service.</param>
        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/> and <paramref name="detailLevel"/>.</param>
        /// <returns>An <see cref="IPagedEnumerable{NodeFile}"/> that can be used to enumerate files asynchronously or synchronously.</returns>
        /// <remarks>This method returns immediately; the file data is retrieved from the Batch service only when the collection is enumerated.
        /// Retrieval is non-atomic; file data is retrieved in pages during enumeration of the collection.</remarks>
        public IPagedEnumerable <NodeFile> ListNodeFiles(bool?recursive = null, DetailLevel detailLevel = null, IEnumerable <BatchClientBehavior> additionalBehaviors = null)
        {
            UtilitiesInternal.ThrowOnUnbound(this.propertyContainer.BindingState);

            // craft the behavior manager for this call
            BehaviorManager bhMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors);

            IPagedEnumerable <NodeFile> enumerator = this.parentBatchClient.JobOperations.ListNodeFilesImpl(this.parentJobId, this.Id, recursive, bhMgr, detailLevel);

            return(enumerator);
        }
Ejemplo n.º 7
0
        public SimpleMesh GetWorldMesh(DetailLevel lod, SimulationObject parent)
        {
            int i = (int)lod;

            if (WorldTransformedMeshes[i] != null)
            {
                return WorldTransformedMeshes[i];
            }
            else
            {
                // Get the untransformed mesh
                SimpleMesh mesh = GetMesh(lod);

                // Copy to our new mesh
                SimpleMesh transformedMesh = new SimpleMesh();
                transformedMesh.Indices = new List<ushort>(mesh.Indices);
                transformedMesh.Path.Open = mesh.Path.Open;
                transformedMesh.Path.Points = new List<PathPoint>(mesh.Path.Points);
                transformedMesh.Prim = mesh.Prim;
                transformedMesh.Profile.Concave = mesh.Profile.Concave;
                transformedMesh.Profile.Faces = new List<ProfileFace>(mesh.Profile.Faces);
                transformedMesh.Profile.MaxX = mesh.Profile.MaxX;
                transformedMesh.Profile.MinX = mesh.Profile.MinX;
                transformedMesh.Profile.Open = mesh.Profile.Open;
                transformedMesh.Profile.Positions = new List<Vector3>(mesh.Profile.Positions);
                transformedMesh.Profile.TotalOutsidePoints = mesh.Profile.TotalOutsidePoints;
                transformedMesh.Vertices = new List<Vertex>(mesh.Vertices);

                // Construct a matrix to transform to world space
                Matrix4 transform = Matrix4.Identity;

                if (parent != null)
                {
                    // Apply parent rotation and translation first
                    transform *= Matrix4.CreateFromQuaternion(parent.Prim.Rotation);
                    transform *= Matrix4.CreateTranslation(parent.Prim.Position);
                }

                transform *= Matrix4.CreateScale(this.Prim.Scale);
                transform *= Matrix4.CreateFromQuaternion(this.Prim.Rotation);
                transform *= Matrix4.CreateTranslation(this.Prim.Position);

                // Transform the mesh
                for (int j = 0; j < transformedMesh.Vertices.Count; j++)
                {
                    Vertex vertex = transformedMesh.Vertices[j];
                    vertex.Position *= transform;
                    transformedMesh.Vertices[j] = vertex;
                }

                WorldTransformedMeshes[i] = transformedMesh;
                return transformedMesh;
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Get the user details
        /// </summary>
        /// <param name="userId">the user id</param>
        /// <param name="detailLevel">the detail level</param>
        /// <returns>the async state</returns>
        public IAsyncResult GetUserDetails(int userId, DetailLevel detailLevel)
        {
            if (!ServiceHelper.TestCallPrerequisites(this, this.GetUserDetailsCompleted, this.etsyContext))
            {
                return null;
            }

            UriBuilder uriBuilder = UriBuilder.Start(this.etsyContext, "users", userId)
                .DetailLevel(detailLevel);

            return ServiceHelper.GenerateRequest(this, uriBuilder.Result(), this.GetUserDetailsCompleted);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Get the user details
        /// </summary>
        /// <param name="userId">the user id</param>
        /// <param name="detailLevel">the detail level</param>
        /// <returns>the async state</returns>
        public IAsyncResult GetUserDetails(int userId, DetailLevel detailLevel)
        {
            if (!RequestHelper.TestCallPrerequisites(this, this.GetUserDetailsCompleted, this.etsyContext))
            {
                return null;
            }

            EtsyUriBuilder etsyUriBuilder = EtsyUriBuilder.Start(this.etsyContext, "users", userId)
                .DetailLevel(detailLevel);

            return this.dataRetriever.StartRetrieve(etsyUriBuilder.Result(), this.GetUserDetailsCompleted);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Gets the specified <see cref="CloudTask"/>.
        /// </summary>
        /// <param name="taskId">The id of the task to get.</param>
        /// <param name="detailLevel">A <see cref="DetailLevel"/> used for controlling which properties are retrieved from the service.</param>
        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/> and <paramref name="detailLevel"/>.</param>
        /// <returns>A <see cref="CloudTask"/> containing information about the specified Azure Batch task.</returns>
        /// <remarks>This is a blocking operation. For a non-blocking equivalent, see <see cref="GetTaskAsync"/>.</remarks>
        public CloudTask GetTask(
            string taskId,
            DetailLevel detailLevel = null,
            IEnumerable <BatchClientBehavior> additionalBehaviors = null)
        {
            using (System.Threading.Tasks.Task <CloudTask> asyncTask = GetTaskAsync(taskId, detailLevel, additionalBehaviors))
            {
                CloudTask cloudTask = asyncTask.WaitAndUnaggregateException(this.CustomBehaviors, additionalBehaviors);

                return(cloudTask);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Enumerates the <see cref="CloudTask">tasks</see> of this <see cref="CloudJob"/>.
        /// </summary>
        /// <param name="detailLevel">A <see cref="DetailLevel"/> used for filtering the list and for controlling which properties are retrieved from the service.</param>
        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/> and <paramref name="detailLevel"/>.</param>
        /// <returns>An <see cref="IPagedEnumerable{CloudTask}"/> that can be used to enumerate tasks asynchronously or synchronously.</returns>
        /// <remarks>This method returns immediately; the tasks are retrieved from the Batch service only when the collection is enumerated.
        /// Retrieval is non-atomic; tasks are retrieved in pages during enumeration of the collection.</remarks>
        public IPagedEnumerable <CloudTask> ListTasks(DetailLevel detailLevel = null, IEnumerable <BatchClientBehavior> additionalBehaviors = null)
        {
            // throw if if this object is unbound
            UtilitiesInternal.ThrowOnUnbound(this.propertyContainer.BindingState);

            // craft the behavior manager for this call
            BehaviorManager behaveMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors);

            IPagedEnumerable <CloudTask> ienumAsync = this.parentBatchClient.JobOperations.ListTasksImpl(this.Id, behaveMgr, detailLevel);

            return(ienumAsync);
        }
Ejemplo n.º 12
0
 public IActionResult Post([FromBody] DetailLevel value)
 {
     try
     {
         _context.DetailLevels.Add(value);
         _context.SaveChanges();
         return(Ok(value));
     }
     catch (System.Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Ejemplo n.º 13
0
        /// <summary>
        /// Query for users by name
        /// </summary>
        /// <param name="searchName">the name to search for</param>
        /// <param name="offset">the searh results offset</param>
        /// <param name="limit">the search limit</param>
        /// <param name="detailLevel">the level of detail</param>
        /// <returns>the async state</returns>
        public IAsyncResult GetUsersByName(string searchName, int offset, int limit, DetailLevel detailLevel)
        {
            if (!ServiceHelper.TestCallPrerequisites(this, this.GetUsersByNameCompleted, this.etsyContext))
            {
                return null;
            }

            UriBuilder uriBuilder = UriBuilder.Start(this.etsyContext, "users/keywords", searchName)
                .OffsetLimit(offset, limit)
                .DetailLevel(detailLevel);

            return ServiceHelper.GenerateRequest(this, uriBuilder.Result(), this.GetUsersByNameCompleted);
        }
Ejemplo n.º 14
0
        public FacetedMesh GenerateFacetedMesh(Primitive prim, DetailLevel lod)
        {
            Path path = GeneratePath();
            Profile profile = GenerateProfile();

            FacetedMesh mesh = new FacetedMesh();
            mesh.Prim = prim;
            mesh.Path = path;
            mesh.Profile = profile;
            mesh.Faces = GenerateFaces(prim.Textures);

            return mesh;
        }
Ejemplo n.º 15
0
        public static Mesh GetLineMesh(LineGeometry geometry, LineEndCap endCaps, DetailLevel detail)
        {
            switch (geometry)
            {
            case LineGeometry.Billboard:
            case LineGeometry.Flat2D:
                return(QuadMesh[0]);

            case LineGeometry.Volumetric3D:
                return(endCaps == LineEndCap.Round ? CapsuleMesh[(int)detail] : CylinderMesh[(int)detail]);
            }

            return(default);
Ejemplo n.º 16
0
        /// <summary>
        /// Get the expanded details on featured listings of a shop, ordered by highest ranked featured item.
        /// </summary>
        /// <param name="userName">the user name</param>
        /// <param name="detailLevel">the level of detail</param>
        /// <returns>the async state</returns>
        public IAsyncResult GetFeaturedDetails(string userName, DetailLevel detailLevel)
        {
            if (!ServiceHelper.TestCallPrerequisites(this, this.GetFeaturedDetailsCompleted, this.etsyContext))
            {
                return null;
            }

            UriBuilder uriBuilder = UriBuilder.Start(this.etsyContext, "shops/", userName)
                .Append("/listings/featured")
                .DetailLevel(detailLevel);

            return ServiceHelper.GenerateRequest(this, uriBuilder.Result(), this.GetFeaturedDetailsCompleted);
        }
Ejemplo n.º 17
0
 internal AsyncListSubtasksEnumerator(
     JobOperations parentJobOperations,
     string jobId,
     string taskId,
     BehaviorManager behaviorMgr,
     DetailLevel detailLevel)
 {
     _parentJobOperations = parentJobOperations;
     _jobId       = jobId;
     _taskId      = taskId;
     _behaviorMgr = behaviorMgr;
     _detailLevel = detailLevel;
 }
 internal AsyncListPoolUsageMetricsEnumerator(
     PoolOperations parentPoolOperations,
     DateTime?startTime,
     DateTime?endTime,
     BehaviorManager behaviorMgr,
     DetailLevel detailLevel)
 {
     _parentPoolOperations = parentPoolOperations;
     _behaviorMgr          = behaviorMgr;
     _startTime            = startTime;
     _endTime     = endTime;
     _detailLevel = detailLevel;
 }
Ejemplo n.º 19
0
 public SimulationVisualPathMarker2D(
     IBotInfo bot,
     DetailLevel detailLevel,
     Transformation2D transformer,
     double strokeThickness,
     MouseButtonEventHandler elementClickAction,
     SimulationAnimation2D controller)
     : base(detailLevel, transformer, strokeThickness, elementClickAction, controller)
 {
     _bot = bot;
     // Init geometry
     Stroke          = VisualizationConstants.BrushGoalMarker;
     StrokeThickness = StrokeThicknessReference * VisualizationConstants.PATH_MARKER_STROKE_THICKNESS_FACTOR;
 }
Ejemplo n.º 20
0
 public override void Read(PackFileDeserializer des, BinaryReaderEx br)
 {
     base.Read(des, br);
     m_localAabb = new hkAabb();
     m_localAabb.Read(des, br);
     m_localPoints           = des.ReadVector4Array(br);
     m_silhouetteSizes       = des.ReadInt32Array(br);
     m_weldTolerance         = br.ReadSingle();
     m_silhouetteDetailLevel = (DetailLevel)br.ReadByte();
     m_flags = br.ReadByte();
     m_localPointsChanged = br.ReadBoolean();
     m_isEnabled          = br.ReadBoolean();
     br.ReadUInt64();
 }
Ejemplo n.º 21
0
        /// <summary>
        /// Get all the users who call this listing a favorite.
        /// </summary>
        /// <param name="listingId">the listing's numeric ID</param>
        /// <param name="offset">To page through large result sets, set offset to a multiple of limit</param>
        /// <param name="limit">Specify the number of results to return</param>
        /// <param name="detailLevel">Control how much information to return</param>
        /// <returns>The Async state of the request</returns>
        public IAsyncResult GetFavorersOfListing(int listingId, int offset, int limit, DetailLevel detailLevel)
        {
            if (!ServiceHelper.TestCallPrerequisites(this, this.GetFavorersOfListingCompleted, this.etsyContext))
            {
                return null;
            }

            UriBuilder uriBuilder = UriBuilder.Start(this.etsyContext, "listings", listingId)
                .Append("/favorers")
                .OffsetLimit(offset, limit)
                .DetailLevel(detailLevel);

            return ServiceHelper.GenerateRequest(this, uriBuilder.Result(), this.GetFavorersOfListingCompleted);
        }
Ejemplo n.º 22
0
        public SimpleMesh GenerateSimpleMesh(Primitive prim, DetailLevel lod)
        {
            Path path = GeneratePath();
            Profile profile = GenerateProfile();

            SimpleMesh mesh = new SimpleMesh();
            mesh.Prim = prim;
            mesh.Path = path;
            mesh.Profile = profile;
            mesh.Vertices = GenerateVertices();
            mesh.Indices = GenerateIndices();

            return mesh;
        }
Ejemplo n.º 23
0
 /// <summary>
 /// For use when a CollectorHost raise an alert
 /// </summary>
 /// <param name="alertLevel"></param>
 /// <param name="detailLevel"></param>
 /// <param name="raisedFor"></param>
 private void SendNotifierAlert(AlertLevel alertLevel, DetailLevel detailLevel, CollectorHost raisedFor)
 {
     if (raisedFor != null)
     {
         SendNotifierAlert(new AlertRaised()
         {
             Level       = alertLevel,
             DetailLevel = detailLevel,
             RaisedFor   = raisedFor,
             MessageRaw  = raisedFor.CurrentState.ReadAllRawDetails(),
             MessageHTML = raisedFor.CurrentState.ReadAllHtmlDetails()
         });
     }
 }
Ejemplo n.º 24
0
        public FacetedMesh GenerateFacetedMesh(Primitive prim, DetailLevel lod)
        {
            Path    path    = GeneratePath();
            Profile profile = GenerateProfile();

            FacetedMesh mesh = new FacetedMesh();

            mesh.Prim    = prim;
            mesh.Path    = path;
            mesh.Profile = profile;
            mesh.Faces   = GenerateFaces(prim.Textures);

            return(mesh);
        }
Ejemplo n.º 25
0
 public SimulationVisualDestinationMarker2D(
     IBotInfo bot,
     DetailLevel detailLevel,
     Transformation2D transformer,
     double strokeThickness,
     MouseButtonEventHandler elementClickAction,
     SimulationAnimation2D controller)
     : base(detailLevel, transformer, strokeThickness, elementClickAction, controller)
 {
     _bot = bot;
     // Init geometry
     _geometry       = new LineGeometry(new Point(0, 0), new Point(0, 0));
     Stroke          = VisualizationConstants.BrushDestinationMarker;
     StrokeThickness = StrokeThicknessReference * VisualizationConstants.DESTINATION_MARKER_STROKE_THICKNESS_FACTOR;
 }
Ejemplo n.º 26
0
 /// <summary>
 /// For sending generic alerts where no Collector is in volved
 /// </summary>
 /// <param name="alertLevel"></param>
 /// <param name="detailLevel"></param>
 /// <param name="statusMessage"></param>
 /// <param name="collectorState"></param>
 private void SendNotifierAlert(AlertLevel alertLevel, DetailLevel detailLevel, string messageRaw, string messageHtml = "")
 {
     if (messageHtml == null || messageHtml.Length == 0)
     {
         messageHtml = string.Format("<p>{0}</p>", messageRaw.EscapeXml());
     }
     SendNotifierAlert(new AlertRaised()
     {
         Level       = alertLevel,
         DetailLevel = detailLevel,
         RaisedFor   = null,
         MessageRaw  = messageRaw,
         MessageHTML = messageHtml
     });
 }
 internal AsyncListNodeFilesByNodeEnumerator(
     PoolOperations parentPoolOperations,
     string poolId,
     string computeNodeId,
     bool?recursive,
     BehaviorManager behaviorMgr,
     DetailLevel detailLevel)
 {
     _parentPoolOperations = parentPoolOperations;
     _poolId        = poolId;
     _computeNodeId = computeNodeId;
     _recursive     = recursive;
     _behaviorMgr   = behaviorMgr;
     _detailLevel   = detailLevel;
 }
Ejemplo n.º 28
0
        public SimpleMesh GenerateSimpleMesh(Primitive prim, DetailLevel lod)
        {
            Path    path    = GeneratePath();
            Profile profile = GenerateProfile();

            SimpleMesh mesh = new SimpleMesh();

            mesh.Prim     = prim;
            mesh.Path     = path;
            mesh.Profile  = profile;
            mesh.Vertices = GenerateVertices();
            mesh.Indices  = GenerateIndices();

            return(mesh);
        }
Ejemplo n.º 29
0
 internal AsyncListNodeFilesByTaskEnumerator(
     JobOperations jobOperations,
     string jobId,
     string taskId,
     bool?recursive,
     BehaviorManager behaviorMgr,
     DetailLevel detailLevel)
 {
     this._jobOperations = jobOperations;
     this._jobId         = jobId;
     this._taskId        = taskId;
     this._recursive     = recursive;
     this._behaviorMgr   = behaviorMgr;
     this._detailLevel   = detailLevel;
 }
Ejemplo n.º 30
0
        /// <summary>
        /// Refreshes the current <see cref="ComputeNode"/>.
        /// </summary>
        /// <param name="detailLevel">The detail level for the refresh. If a detail level which omits the <see cref="Id"/> property is specified, refresh will fail.</param>
        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/>.</param>
        /// <param name="cancellationToken">A <see cref="CancellationToken"/> for controlling the lifetime of the asynchronous operation.</param>
        /// <returns>A <see cref="Task"/> representing the asynchronous refresh operation.</returns>
        public async Task RefreshAsync(DetailLevel detailLevel = null, IEnumerable <BatchClientBehavior> additionalBehaviors = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            // create the behavior manager
            BehaviorManager bhMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors, detailLevel);

            System.Threading.Tasks.Task <AzureOperationResponse <Models.ComputeNode, Models.ComputeNodeGetHeaders> > asyncTask =
                this.parentBatchClient.ProtocolLayer.GetComputeNode(this.parentPoolId, this.Id, bhMgr, cancellationToken);

            AzureOperationResponse <Models.ComputeNode, Models.ComputeNodeGetHeaders> response = await asyncTask.ConfigureAwait(continueOnCapturedContext : false);

            // get pool from response
            Models.ComputeNode newProtocolComputeNode = response.Body;

            this.propertyContainer = new PropertyContainer(newProtocolComputeNode);
        }
Ejemplo n.º 31
0
        public SimulationVisualBot3D(IBotInfo bot, DetailLevel detailLevel)
            : base(bot)
        {
            Bot = bot;
            var visual = new BoxVisual3D
            {
                Fill   = VisualizationConstants.BrushBotVisual,
                Center = new Point3D(0, 0, 0),
                Length = Bot.GetInfoRadius() * 2,
                Width  = Bot.GetInfoRadius() * 2,
                Height = _height,
            };

            Children.Add(visual);
        }
Ejemplo n.º 32
0
        public SimpleMesh GenerateSimpleMesh(Primitive prim, DetailLevel lod)
        {
            float detail = DETAIL_LEVELS[(int)lod];

            Path path = GeneratePath(prim.Data, detail);
            Profile profile = GenerateProfile(prim.Data, path, detail);

            SimpleMesh mesh = new SimpleMesh();
            mesh.Prim = prim;
            mesh.Path = path;
            mesh.Profile = profile;
            mesh.Vertices = GenerateVertices(prim.Data, detail, path, profile);
            mesh.Indices = GenerateIndices(prim.Data, path, profile);

            return mesh;
        }
Ejemplo n.º 33
0
        public SimpleMesh GetMesh(DetailLevel lod)
        {
            int i = (int)lod;

            if (Meshes[i] != null)
            {
                return Meshes[i];
            }
            else
            {
                Primitive prim = (Primitive)Prim;
                SimpleMesh mesh = Server.Mesher.GenerateSimpleMesh(prim, lod);
                Meshes[i] = mesh;
                return mesh;
            }
        }
Ejemplo n.º 34
0
        public SimpleMesh GetMesh(DetailLevel lod)
        {
            int i = (int)lod;

            if (Meshes[i] != null)
            {
                return(Meshes[i]);
            }
            else
            {
                Primitive  prim = (Primitive)Prim;
                SimpleMesh mesh = Server.Mesher.GenerateSimpleMesh(prim, lod);
                Meshes[i] = mesh;
                return(mesh);
            }
        }
Ejemplo n.º 35
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SceneObject"/> class.
        /// </summary>
        protected SceneObject()
        {
            m_targetDetailLevel = DetailLevel.All;

            m_children = new List <SceneObject>();
            m_parent   = null;

            m_behaviors        = new List <SceneObjectBehavior>();
            m_animationHandler = new AnimationHandler(this);
            m_visibilityData   = new IndexBasedDynamicCollection <VisibilityCheckData>();

            //Create a dynamic container for custom data
            m_customData = new ExpandoObject();

            this.TransormationChanged = true;
            this.IsPickingTestVisible = true;
        }
Ejemplo n.º 36
0
 /// <summary>
 /// Creates a new Geometry Object
 /// </summary>
 /// <param name="model">The Model</param>
 /// <param name="drawlevel">The Render Level</param>
 /// <param name="lvl">The Detail Level</param>
 /// <param name="x">World X</param>
 /// <param name="y">World Y</param>
 /// <param name="z">World Z</param>
 /// <param name="yaw">Yaw</param>
 /// <param name="pitch">Pitch</param>
 /// <param name="roll">Roll</param>
 public GeometryObj(IModul modul, Model model, DrawLevel drawlevel, DetailLevel lvl, float x, float y, float z, float yaw,
                    float pitch, float roll, Vector3 scale, bool isMovable, Boolean showHeading)
 {
     Modul       = modul;
     Model       = model;
     DrawLevel   = drawlevel;
     DetailLevel = lvl;
     X           = x;
     Y           = y;
     Z           = z;
     Yaw         = yaw;
     Pitch       = pitch;
     Roll        = roll;
     ScaleVector = scale;
     IsMovable   = isMovable;
     ShowHeading = showHeading;
 }
Ejemplo n.º 37
0
        public void Pin(bool asDraftOnly)
        {
            if (mapMagic.draftsInEditor && draft == null)
            {
                draft = new DetailLevel(this, isDraft: true);
            }

            if (!asDraftOnly && main == null)
            {
                main = new DetailLevel(this, isDraft: false);
            }

            if (asDraftOnly && main != null)
            {
                main.Remove(); main = null;
            }
        }
Ejemplo n.º 38
0
        /// <summary>
        /// Gets the specified <see cref="CloudTask"/>.
        /// </summary>
        /// <param name="taskId">The id of the task to get.</param>
        /// <param name="detailLevel">A <see cref="DetailLevel"/> used for controlling which properties are retrieved from the service.</param>
        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/> and <paramref name="detailLevel"/>.</param>
        /// <param name="cancellationToken">A <see cref="CancellationToken"/> for controlling the lifetime of the asynchronous operation.</param>
        /// <returns>A <see cref="CloudTask"/> containing information about the specified Azure Batch task.</returns>
        /// <remarks>The get task operation runs asynchronously.</remarks>
        public async System.Threading.Tasks.Task <CloudTask> GetTaskAsync(
            string taskId,
            DetailLevel detailLevel = null,
            IEnumerable <BatchClientBehavior> additionalBehaviors = null,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            // throw if if this object is unbound
            UtilitiesInternal.ThrowOnUnbound(this.propertyContainer.BindingState);

            // craft the behavior manager for this call
            BehaviorManager bhMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors, detailLevel);

            Task <CloudTask> asyncTask = this.parentBatchClient.JobOperations.GetTaskAsyncImpl(this.Id, taskId, bhMgr, cancellationToken);
            CloudTask        theTask   = await asyncTask.ConfigureAwait(continueOnCapturedContext : false);

            return(theTask);
        }
Ejemplo n.º 39
0
        public FacetedMesh GenerateFacetedMesh(Primitive prim, DetailLevel lod)
        {
            float detail = DETAIL_LEVELS[(int)lod];

            Path path = GeneratePath(prim.Data, detail);
            Profile profile = GenerateProfile(prim.Data, path, detail);

            List<Vertex> vertices = GenerateVertices(prim.Data, detail, path, profile);

            FacetedMesh mesh = new FacetedMesh();
            mesh.Prim = prim;
            mesh.Path = path;
            mesh.Profile = profile;
            mesh.Faces = CreateVolumeFaces(prim, path, profile, vertices);

            return mesh;
        }
Ejemplo n.º 40
0
        /// <summary>
        /// Refreshes the current <see cref="Certificate"/>.
        /// </summary>
        /// <param name="detailLevel">The detail level for the refresh.  If a detail level which omits the <see cref="Thumbprint"/> or <see cref="ThumbprintAlgorithm"/> property is specified, refresh will fail.</param>
        /// <param name="additionalBehaviors">A collection of <see cref="BatchClientBehavior"/> instances that are applied to the Batch service request after the <see cref="CustomBehaviors"/>.</param>
        /// <param name="cancellationToken">A <see cref="CancellationToken"/> for controlling the lifetime of the asynchronous operation.</param>
        /// <returns>A <see cref="Task"/> representing the asynchronous refresh operation.</returns>
        public async Task RefreshAsync(DetailLevel detailLevel = null, IEnumerable <BatchClientBehavior> additionalBehaviors = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            // set up behavior manager
            BehaviorManager bhMgr = new BehaviorManager(this.CustomBehaviors, additionalBehaviors, detailLevel);

            // start operation
            Task <AzureOperationResponse <Models.Certificate, Models.CertificateGetHeaders> > asyncTask =
                this.parentBatchClient.ProtocolLayer.GetCertificate(this.ThumbprintAlgorithm, this.Thumbprint, bhMgr, cancellationToken);

            AzureOperationResponse <Models.Certificate, Models.CertificateGetHeaders> response = await asyncTask.ConfigureAwait(continueOnCapturedContext : false);

            // extract the refreshed protocol object
            Models.Certificate refreshedProtoCert = response.Body;

            // swap in the new protocol object
            this.propertyContainer = new PropertyContainer(refreshedProtoCert);
        }
Ejemplo n.º 41
0
        public SimulationVisualTier3D(ITierInfo tier, DetailLevel detailLevel)
            : base(tier)
        {
            _tier = tier;
            var visual = new BoxVisual3D
            {
                Fill   = VisualizationConstants.BrushTierVisual,
                Center = new Point3D(
                    (_tier.GetInfoTLX() + _tier.GetInfoLength()) / 2.0,
                    (_tier.GetInfoTLY() + _tier.GetInfoWidth()) / 2.0,
                    _tier.GetInfoZ() - TIER_HEIGHT / 2.0),
                Length = _tier.GetInfoLength(),
                Width  = _tier.GetInfoWidth(),
                Height = TIER_HEIGHT
            };

            Children.Add(visual);
        }
Ejemplo n.º 42
0
        public override async System.Threading.Tasks.Task RefreshAsync(DetailLevel detailLevel = null, IEnumerable <BatchClientBehavior> additionalBehaviors = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            // create the behavior managaer
            BehaviorManager bhMgr = new BehaviorManager(base.CustomBehaviors, additionalBehaviors, detailLevel);

            System.Threading.Tasks.Task <AzureOperationResponse <Models.NodeFile, Models.FileGetNodeFilePropertiesFromTaskHeaders> > asyncTask =
                this._jobOperations.ParentBatchClient.ProtocolLayer.GetNodeFilePropertiesByTask(
                    _jobId,
                    _taskId,
                    this.Name,
                    bhMgr,
                    cancellationToken);

            AzureOperationResponse <Models.NodeFile, Models.FileGetNodeFilePropertiesFromTaskHeaders> response = await asyncTask.ConfigureAwait(continueOnCapturedContext : false);

            // immediately available to all threads
            System.Threading.Interlocked.Exchange(ref base.fileItemBox, new FileItemBox(response.Body));
        }
Ejemplo n.º 43
0
        public SimulationVisualWaypoint3D(IWaypointInfo waypoint, DetailLevel detailLevel)
            : base(waypoint)
        {
            _waypoint = waypoint;
            var visual = new SphereVisual3D
            {
                Fill   = VisualizationConstants.BrushWaypointVisual,
                Center = new Point3D(waypoint.GetInfoCenterX(), waypoint.GetInfoCenterY(), waypoint.GetInfoCurrentTier().GetInfoZ() + WAYPOINT_LIFT),
                Radius = waypoint.GetInfoLength() / 2.0
            };

            Children.Add(visual);
            // Add connections to other ones (if detailed drawing mode)
            //foreach (var otherWP in waypoint.GetInfoConnectedWaypoints())
            //{
            //    // TODO draw connection to other wp
            //}
        }
Ejemplo n.º 44
0
        /// <summary>
        /// Get the listings in a gift guide.
        /// </summary>
        /// <param name="guideId">Specify the numeric ID of a Gift Guide </param>
        /// <param name="offset">To page through large result sets, set offset to a multiple of limit</param>
        /// <param name="limit">Specify the number of results to return</param>
        /// <param name="detailLevel">Control how much information to return</param>
        /// <returns>The Async state of the request</returns>
        public IAsyncResult GetGiftGuideListings(int guideId, int offset, int limit, DetailLevel detailLevel)
        {
            if (!RequestHelper.TestCallPrerequisites(this, this.GetGiftGuideListingsCompleted, this.etsyContext))
            {
                return null;
            }

            if (!RequestHelper.TestOffsetLimit(this, this.GetGiftGuideListingsCompleted, offset, limit))
            {
                return null;
            }

            EtsyUriBuilder etsyUriBuilder = EtsyUriBuilder.Start(this.etsyContext, "gift-guides", guideId)
                .Append("/listings")
                .OffsetLimit(offset, limit)
                .DetailLevel(detailLevel);

            return this.dataRetriever.StartRetrieve(etsyUriBuilder.Result(), this.GetGiftGuideListingsCompleted);
        }
Ejemplo n.º 45
0
        public SimpleMesh GenerateSimpleSculptMesh(Primitive prim, Bitmap sculptTexture, DetailLevel lod)
        {
            FacetedMesh facetedMesh = GenerateFacetedSculptMesh(prim, sculptTexture, lod);

            if (facetedMesh != null && facetedMesh.Faces.Count == 1)
            {
                Face face = facetedMesh.Faces[0];

                SimpleMesh mesh = new SimpleMesh();
                mesh.Indices = face.Indices;
                mesh.Vertices = face.Vertices;
                mesh.Path = facetedMesh.Path;
                mesh.Profile = facetedMesh.Profile;
                mesh.Prim = facetedMesh.Prim;

                return mesh;
            }

            return null;
        }
Ejemplo n.º 46
0
        public SimpleMesh GenerateSimpleMesh(Primitive prim, DetailLevel lod)
        {
            Path path = GeneratePath();
            Profile profile = GenerateProfile();

            MeshmerizerMesh meshmerizer = new MeshmerizerMesh();
            meshmerizer = GenerateMeshmerizerMesh(prim);

            // Create the vertex array
            List<Vertex> vertices = new List<Vertex>(meshmerizer.primMesh.coords.Count);
            for (int i = 0; i < meshmerizer.primMesh.coords.Count; i++)
            {
                Coord c = meshmerizer.primMesh.coords[i];
                Vertex vertex = new Vertex();
                vertex.Position = new Vector3(c.X, c.Y, c.Z);
                vertices.Add(vertex);
            }

            // Create the index array
            List<ushort> indices = new List<ushort>(meshmerizer.primMesh.faces.Count * 3);
            for (int i = 0; i < meshmerizer.primMesh.faces.Count; i++)
            {
                MeshmerizerFace f = meshmerizer.primMesh.faces[i];
                indices.Add((ushort)f.v1);
                indices.Add((ushort)f.v2);
                indices.Add((ushort)f.v3);
            }

            SimpleMesh mesh = new SimpleMesh();
            mesh.Prim = prim;
            mesh.Path = path;
            mesh.Profile = profile;
            mesh.Vertices = vertices;
            mesh.Indices = indices;

            return mesh;
        }
Ejemplo n.º 47
0
        /// <summary>
        /// Get featured sellers
        /// </summary>
        /// <param name="offset">the offset in results</param>
        /// <param name="limit">the limit of results</param>
        /// <param name="detailLevel">the detail level</param>
        /// <returns>the async state</returns>
        public IAsyncResult GetFeaturedSellers(int offset, int limit, DetailLevel detailLevel)
        {
            if (!RequestHelper.TestCallPrerequisites(this, this.GetFeaturedSellersCompleted, this.etsyContext))
            {
                return null;
            }

            EtsyUriBuilder etsyUriBuilder = EtsyUriBuilder.Start(this.etsyContext, "shops/featured")
                .OffsetLimit(offset, limit)
                .DetailLevel(detailLevel);

            return this.dataRetriever.StartRetrieve(etsyUriBuilder.Result(), this.GetFeaturedSellersCompleted);
        }
Ejemplo n.º 48
0
        private PrimMesher.PrimMesh GeneratePrimMesh(Primitive prim, DetailLevel lod, bool viewerMode)
        {
            OMV.Primitive.ConstructionData primData = prim.PrimData;
            int sides = 4;
            int hollowsides = 4;

            float profileBegin = primData.ProfileBegin;
            float profileEnd = primData.ProfileEnd;

            bool isSphere = false;

            if ((OMV.ProfileCurve)(primData.profileCurve & 0x07) == OMV.ProfileCurve.Circle)
            {
                switch (lod)
                {
                    case OMVR.DetailLevel.Low:
                        sides = 6;
                        break;
                    case OMVR.DetailLevel.Medium:
                        sides = 12;
                        break;
                    default:
                        sides = 24;
                        break;
                }
            }
            else if ((OMV.ProfileCurve)(primData.profileCurve & 0x07) == OMV.ProfileCurve.EqualTriangle)
                sides = 3;
            else if ((OMV.ProfileCurve)(primData.profileCurve & 0x07) == OMV.ProfileCurve.HalfCircle)
            {
                // half circle, prim is a sphere
                isSphere = true;
                switch (lod)
                {
                    case OMVR.DetailLevel.Low:
                        sides = 6;
                        break;
                    case OMVR.DetailLevel.Medium:
                        sides = 12;
                        break;
                    default:
                        sides = 24;
                        break;
                }
                profileBegin = 0.5f * profileBegin + 0.5f;
                profileEnd = 0.5f * profileEnd + 0.5f;
            }

            if ((OMV.HoleType)primData.ProfileHole == OMV.HoleType.Same)
                hollowsides = sides;
            else if ((OMV.HoleType)primData.ProfileHole == OMV.HoleType.Circle)
            {
                switch (lod)
                {
                    case OMVR.DetailLevel.Low:
                        hollowsides = 6;
                        break;
                    case OMVR.DetailLevel.Medium:
                        hollowsides = 12;
                        break;
                    default:
                        hollowsides = 24;
                        break;
                }
            }
            else if ((OMV.HoleType)primData.ProfileHole == OMV.HoleType.Triangle)
                hollowsides = 3;

            PrimMesher.PrimMesh newPrim = new PrimMesher.PrimMesh(sides, profileBegin, profileEnd, (float)primData.ProfileHollow, hollowsides);
            newPrim.viewerMode = viewerMode;
            newPrim.sphereMode = isSphere;
            newPrim.holeSizeX = primData.PathScaleX;
            newPrim.holeSizeY = primData.PathScaleY;
            newPrim.pathCutBegin = primData.PathBegin;
            newPrim.pathCutEnd = primData.PathEnd;
            newPrim.topShearX = primData.PathShearX;
            newPrim.topShearY = primData.PathShearY;
            newPrim.radius = primData.PathRadiusOffset;
            newPrim.revolutions = primData.PathRevolutions;
            newPrim.skew = primData.PathSkew;
            switch (lod)
            {
                case OMVR.DetailLevel.Low:
                    newPrim.stepsPerRevolution = 6;
                    break;
                case OMVR.DetailLevel.Medium:
                    newPrim.stepsPerRevolution = 12;
                    break;
                default:
                    newPrim.stepsPerRevolution = 24;
                    break;
            }

            if ((primData.PathCurve == OMV.PathCurve.Line) || (primData.PathCurve == OMV.PathCurve.Flexible))
            {
                newPrim.taperX = 1.0f - primData.PathScaleX;
                newPrim.taperY = 1.0f - primData.PathScaleY;
                newPrim.twistBegin = (int)(180 * primData.PathTwistBegin);
                newPrim.twistEnd = (int)(180 * primData.PathTwist);
                newPrim.ExtrudeLinear();
            }
            else
            {
                newPrim.taperX = primData.PathTaperX;
                newPrim.taperY = primData.PathTaperY;
                newPrim.twistBegin = (int)(360 * primData.PathTwistBegin);
                newPrim.twistEnd = (int)(360 * primData.PathTwist);
                newPrim.ExtrudeCircular();
            }

            return newPrim;
        }
Ejemplo n.º 49
0
        /// <summary>
        /// Test retrieving shops by name, all detail levels
        /// </summary>
        /// <param name="detailLevel">the detail level to use</param>
        private static void TestGetShopsByName(DetailLevel detailLevel)
        {
            // ARANGE
            using (AutoResetEvent waitEvent = new AutoResetEvent(false))
            {
                ResultEventArgs<Shops> result = null;

                IShopService shopsService = new ShopService(new EtsyContext(NetsyData.EtsyApiKey));
                shopsService.GetShopsByNameCompleted += (s, e) =>
                {
                    result = e;
                    waitEvent.Set();
                };

                // ACT
                shopsService.GetShopsByName("fred", SortOrder.Up, 0, 10, detailLevel);
                bool signalled = waitEvent.WaitOne(NetsyData.WaitTimeout);

                // ASSERT
                // check that the event was fired, did not time out
                Assert.IsTrue(signalled, "Not signalled");

                // check the data
                TestHelpers.CheckResultSuccess(result);

                Assert.IsNotNull(result.ResultValue.Results);
                Assert.IsTrue(result.ResultStatus.Success);
                Assert.IsTrue(result.ResultValue.Count > 0);
            }
        }
Ejemplo n.º 50
0
 /// <summary>
 /// Returns a list of JobSchedules
 /// </summary>
 /// <returns></returns>
 public IPagedEnumerable<CloudJobSchedule> ListJobSchedules(DetailLevel detailLevel = null)
 {
     return this.Client.JobScheduleOperations.ListJobSchedules(detailLevel);
 }
Ejemplo n.º 51
0
 public Task<CloudTask> GetTaskAsync(string jobId, string taskId, DetailLevel detailLevel)
 {
     return this.Client.JobOperations.GetTaskAsync(jobId, taskId, detailLevel);
  
 }
Ejemplo n.º 52
0
 public CloudTask GetTask(string jobId, string taskId, DetailLevel detailLevel)
 {
     using (Task<CloudTask> getTaskTask = this.GetTaskAsync(jobId, taskId, detailLevel))
     {
         getTaskTask.Wait();
         return getTaskTask.Result;
     }
 }
Ejemplo n.º 53
0
        /// <summary>
        /// Get the expanded details on featured listings of a shop, ordered by highest ranked featured item.
        /// </summary>
        /// <param name="userName">the user name</param>
        /// <param name="detailLevel">the level of detail</param>
        /// <returns>the async state</returns>
        public IAsyncResult GetFeaturedDetails(string userName, DetailLevel detailLevel)
        {
            if (!RequestHelper.TestCallPrerequisites(this, this.GetFeaturedDetailsCompleted, this.etsyContext))
            {
                return null;
            }

            EtsyUriBuilder etsyUriBuilder = EtsyUriBuilder.Start(this.etsyContext, "shops/", userName)
                .Append("/listings/featured")
                .DetailLevel(detailLevel);

            return this.dataRetriever.StartRetrieve(etsyUriBuilder.Result(), this.GetFeaturedDetailsCompleted);
        }
Ejemplo n.º 54
0
        /// <summary>
        /// Get all the listings in a shop.
        /// </summary>
        /// <param name="userName">the user name</param>
        /// <param name="sortOn">field to sort on</param>
        /// <param name="sortOrder">sort ascending or descending</param>
        /// <param name="sectionId">shop section to show</param>
        /// <param name="offset">the search results offset</param>
        /// <param name="limit">the search limit</param>
        /// <param name="detailLevel">the level of detail</param>
        /// <returns>the async state</returns>
        public IAsyncResult GetShopListings(string userName, SortField sortOn, SortOrder sortOrder, int? sectionId, int offset, int limit, DetailLevel detailLevel)
        {
            if (!RequestHelper.TestCallPrerequisites(this, this.GetShopListingsCompleted, this.etsyContext))
            {
                return null;
            }

            EtsyUriBuilder etsyUriBuilder = EtsyUriBuilder.Start(this.etsyContext, "shops", userName)
                .Append("/listings")
                .Sort(sortOn, sortOrder)
                .OptionalParam("section_id", sectionId)
                .OffsetLimit(offset, limit)
                .DetailLevel(detailLevel);

            return this.dataRetriever.StartRetrieve(etsyUriBuilder.Result(), this.GetShopListingsCompleted);
        }
Ejemplo n.º 55
0
 public SimpleMesh GenerateSimpleSculptMesh(Primitive prim, System.Drawing.Bitmap sculptTexture, DetailLevel lod)
 {
     return GenerateSimpleMesh(prim, lod);
 }
Ejemplo n.º 56
0
 public FacetedMesh GenerateFacetedSculptMesh(Primitive prim, System.Drawing.Bitmap sculptTexture, DetailLevel lod)
 {
     return GenerateFacetedMesh(prim, lod);
 }
Ejemplo n.º 57
0
        /// <summary>
        /// Get shops by name
        /// </summary>
        /// <param name="searchName">the text to search for</param>
        /// <param name="sortOrder">the results order</param>
        /// <param name="offset">the results offset</param>
        /// <param name="limit">the results limit</param>
        /// <param name="detailLevel">detail level</param>
        /// <returns>the async state</returns>
        public IAsyncResult GetShopsByName(string searchName, SortOrder sortOrder, int offset, int limit, DetailLevel detailLevel)
        {
            if (!RequestHelper.TestCallPrerequisites(this, this.GetShopsByNameCompleted, this.etsyContext))
            {
                return null;
            }

            EtsyUriBuilder etsyUriBuilder = EtsyUriBuilder.Start(this.etsyContext, "shops/keywords", searchName)
                .SortOrder(sortOrder)
                .OffsetLimit(offset, limit)
                .DetailLevel(detailLevel);

            return this.dataRetriever.StartRetrieve(etsyUriBuilder.Result(), this.GetShopsByNameCompleted);
        }
Ejemplo n.º 58
0
 public CloudJob GetJob(string jobId, DetailLevel detailLevel)
 {
     using (System.Threading.Tasks.Task<CloudJob> getJobTask = this.GetJobAsync(jobId, detailLevel))
     {
         getJobTask.Wait();
         return getJobTask.Result;
     }
 }
Ejemplo n.º 59
0
 /// <summary>
 /// Returns a list of pools
 /// </summary>
 /// <returns></returns>
 public IPagedEnumerable<CloudPool> ListPools(DetailLevel detailLevel = null)
 {
     return this.Client.PoolOperations.ListPools(detailLevel);
 }
Ejemplo n.º 60
0
 public Task<CloudJob> GetJobAsync(string jobId, DetailLevel detailLevel)
 {
     return this.Client.JobOperations.GetJobAsync(jobId, detailLevel);
 }