Search Results

Search found 902 results on 37 pages for 'circle'.

Page 10/37 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • All libGDX input statements are returning TRUE at once

    - by MowDownJoe
    I'm fooling around with Box2D and libGDX and running into a peculiar problem with polling for input. Here's the code for the Screen's render() loop: @Override public void render(float delta) { Gdx.gl20.glClearColor(0, 0, .2f, 1); Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT); camera.update(); game.batch.setProjectionMatrix(camera.combined); debugRenderer.render(world, camera.combined); if(Gdx.input.isButtonPressed(Keys.LEFT)){ Gdx.app.log("Input", "Left is being pressed."); pushyThingyBody.applyForceToCenter(-10f, 0); } if(Gdx.input.isButtonPressed(Keys.RIGHT)){ Gdx.app.log("Input", "Right is being pressed."); pushyThingyBody.applyForceToCenter(10f, 0); } world.step((1f/45f), 6, 2); } And the constructor is largely just setting up the World, Box2DDebugRenderer, and all the Bodies in the world: public SandBox(PhysicsSandboxGame game) { this.game = game; camera = new OrthographicCamera(800, 480); camera.setToOrtho(false); world = new World(new Vector2(0, -9.8f), true); debugRenderer = new Box2DDebugRenderer(); BodyDef bodyDef = new BodyDef(); bodyDef.type = BodyType.DynamicBody; bodyDef.position.set(100, 300); body = world.createBody(bodyDef); CircleShape circle = new CircleShape(); circle.setRadius(6f); FixtureDef fixtureDef = new FixtureDef(); fixtureDef.shape = circle; fixtureDef.density = .5f; fixtureDef.friction = .4f; fixtureDef.restitution = .6f; fixture = body.createFixture(fixtureDef); circle.dispose(); BodyDef groundBodyDef = new BodyDef(); groundBodyDef.position.set(new Vector2(0, 10)); groundBody = world.createBody(groundBodyDef); PolygonShape groundBox = new PolygonShape(); groundBox.setAsBox(camera.viewportWidth, 10f); groundBody.createFixture(groundBox, 0f); groundBox.dispose(); BodyDef pushyThingyBodyDef = new BodyDef(); pushyThingyBodyDef.type = BodyType.DynamicBody; pushyThingyBodyDef.position.set(new Vector2(400, 30)); pushyThingyBody = world.createBody(pushyThingyBodyDef); PolygonShape pushyThingyShape = new PolygonShape(); pushyThingyShape.setAsBox(40f, 10f); FixtureDef pushyThingyFixtureDef = new FixtureDef(); pushyThingyFixtureDef.shape = pushyThingyShape; pushyThingyFixtureDef.density = .4f; pushyThingyFixtureDef.friction = .1f; pushyThingyFixtureDef.restitution = .5f; pushyFixture = pushyThingyBody.createFixture(pushyThingyFixtureDef); pushyThingyShape.dispose(); } Testing this on the desktop. Basically, whenever I hit the appropriate keys, neither of the if statements in the loop return true. However, when I click in the window, both statements return true, resulting in a 0 net force on the body. Why is this?

    Read the article

  • SVG animation along path with Raphael

    - by Toby Hede
    I have a rather interesting issue with SVG animation. I am animating along a circular path using Raphael obj = canvas.circle(x, y, size); path = canvas.circlePath(x, y, radius); path = canvas.path(path); //generate path from path value string obj.animateAlong(path, rate, false); The circlePath method is one I have created myself to generate the circle path in SVG path notation: Raphael.fn.circlePath = function(x , y, r) { var s = "M" + x + "," + (y-r) + "A"+r+","+r+",0,1,1,"+(x-0.1)+","+(y-r)+" z"; return s; } So far, so good. This all works. I have my object (obj) animating along the circular path. BUT: The animation only works if I create the object at the same X, Y coords as the path itself. If I start the animation from any other coordinates (say, half-way along the path) the object animates in a circle of the correct radius, however it starts the animation from the object X,Y coordinates, rather than along the path as it is displayed visually. Ideally I would like to be able to stop/start the animation - the same problem occurs on restart. When I stop then restart the animation, it animates in a circle starting from the stopped X,Y.

    Read the article

  • Certain transformations in Open Inventor(Coin3D)

    - by Marc
    Hi, I am quite new to Open Inventor(Coin3D) and have the following problem: I have a SoSelection holding a root node(also SoSeparator). And the root node holds a number of SoSeparator nodes. Each of these SoSeparator nodes holds a SoTransform node and a SoCube node. When I select one cube node I want all other cubes within a certain distance to the selected cube to arrange in a circle arround the selected cube. (Moreover all of the cubes should be on a plane than) An additional information: My cubes are always oriented in the camera direction with (cubeTransform_-rotation.connectFrom(&camera_-orientation) Assuming the selected cube is the center of the circle, how do I translate the other cubes in a circle on a plane(perpendicular to the vector between the selected cube and the camera)? Especially how do I find coordinates on the plain on which the circle should be which have a certain distance from the Axis (from center cube to camera). What I already did is to search for the for all cubes within a certain distance as soon as one cube is selected. As a result I already have the required separators (which are holding the according SoTransforms and SoCubes) in a SoPathList. Now I want to arrange the cubes by modifing the according SoTransform-translation values. Regards Mark

    Read the article

  • When actually is a closure created?

    - by Jian Lin
    Is it true that a closure is created in the following cases for foo, but not for bar? Case 1: <script type="text/javascript"> function foo() { } </script> foo is a closure with a scope chain with only the global scope. Case 2: <script type="text/javascript"> var i = 1; function foo() { return i; } </script> same as Case 1. Case 3: <script type="text/javascript"> function Circle(r) { this.r = r; } Circle.prototype.foo = function() { return 3.1415 * this.r * this.r } </script> in this case, Circle.prototype.foo (which returns the circle's area) refers to a closure with only the global scope. (this closure is created). Case 4: <script type="text/javascript"> function foo() { function bar() { } } </script> here, foo is a closure with only the global scope, but bar is not a closure (yet), because the function foo is not invoked in the code, so no closure goo is ever created. It will only exist if foo is invoked , and the closure bar will exist until foo returns, and the closure bar will then be garbage collected, since there is no reference to it at all anywhere. So when the function doesn't exist, can't be invoked, can't be referenced, then the closure doesn't exist yet (never created yet). Only when the function can be invoked or can be referenced, then the closure is actually created?

    Read the article

  • Finding intersection of two spheres

    - by Onkar Deshpande
    Hi, Consider the following problem - I am given 2 links of length L0 and L1. P0 is the point that the first link starts at and P1 is the point that I want the end of second link to be at in 3-D space. I am supposed to write a function that should take in these 3-D points (P0 and P1) as inputs and should find all configurations of the links that put the second link's end point at P1. My understanding of how to go about it is - Each link L0 and L1 will create a sphere S0 and S1 around itself. I should find out the intersection of those two spheres (which will be a circle) and print all points that are on the circumference of that circle. I saw gmatt's first reply on the http://stackoverflow.com/questions/1406375/finding-intersection-points-between-3-spheres but could not understand it properly since the images did not show up. I also saw a formula for finding out the intersection at mathworld[dot]wolfram[dot]com/Sphere-SphereIntersection[dot]html . I could find the radius of intersection by the method given on mathworld. Also I can find the center of that circle and then use the parametric equation of circle to find the points. The only doubt that I have is will this method work for the points P0 and P1 mentioned above ? Please comment and let me know your thoughts.

    Read the article

  • C# Vector maths questions

    - by Mark
    Im working in a screen coordinate space that is different to that of the classical X/Y coordinate space, where my Y direction goes down in the positive instead of up. Im also trying to figure out how to make a Circle on my screen always face away from the center point of the screen. If the center point of my screen is at x(200) y(300) and the point of my circle's center is at x(150) and y(380) then I would like to calculate the angle that the circle should be facing. At the moment I have this: Point centerPoint = new Point(200, 300); Point middleBottom = new Point(200, 400); Vector middleVector = new Vector(centerPoint.X - middleBottom.X, centerPoint.Y - middleBottom.Y); Vector vectorOfCircle = new Vector(centerPoint.X - 150, centerPoint.Y - 400); middleVector.Normalize(); vectorOfCircle.Normalize(); var angle = Math.Acos(Vector.CrossProduct(vectorOfCircle, middleVector)); Console.WriteLine("Angle: {0}", angle * (180/Math.PI)); Im not getting what I would expect. I would say that when I enter in x(150) and y(300) of my circle, I would expect to see the rotation of 90 deg, but Im not getting that... Im getting 180!! Any help here would be greatly appreciated. Cheers, Mark

    Read the article

  • Attributes in XML subtree that belong to the parent

    - by Bart van Heukelom
    Say I have this XML <doc:document> <objects> <circle radius="10" doc:colour="red" /> <circle radius="20" doc:colour="blue" /> </objects> </doc:document> And this is how it is parsed (pseudo code): // class DocumentParser public Document parse(Element edoc) { doc = new Document(); doc.objects = ObjectsParser.parse(edoc.getChild("objects")); for ( ...?... ) { doc.objectColours.put(object, colour); } return doc; } ObjectsParser is responsible for parsing the objects bit, but is not and should not be aware of the existence of documents. However, in Document colours are associated with objects by use of a Map. What kind of pattern would you recommend to give the colour settings back to DocumentParser.parse from ObjectsParser.parse so it can associate it with the objects they belong to in a map? The alternative would be something like this: <doc:document> <objects> <circle id="1938" radius="10" /> <circle id="6398" radius="20" /> </objects> <doc:objectViewSettings> <doc:objectViewSetting object="1938" colour="red" /> <doc:objectViewSetting object="6398" colour="blue" /> </doc:objectViewSettings> </doc:document> Ugly!

    Read the article

  • Clicking inside a polygon in Google Maps

    - by amarsh-anand
    The included JavaScript snippet is supposed to do the following: As the user clicks on the map, initialize headMarker and draw a circle (polygon) around it As the user clicks inside the circle, initialize tailMarker and draw the path between these two markers 1 is happening as expected. But as the user clicks inside the circle, in the function(overlay,point), overlay is non-null while point is null. Because of this, the code fails to initialize tailMarker. Can someone tell me a way out. GEvent.addListener(map, "click", function(overlay,point) { if (isCreateHeadPoint) { // add the head marker headMarker = new GMarker(point,{icon:redIcon,title:'0'}); map.addOverlay(headMarker); isCreateHeadPoint = false; // draw the circle drawMapCircle(point.lat(),point.lng(),1,'#cc0000',2,0.8,'#0',0.1); } else { // add the tail marker tailMarker = new GMarker(point,{icon:greenIcon,title:''}); map.addOverlay(tailMarker); isCreateHeadPoint = true; // load thes path from head to tail direction.load("from:" + headMarker.getPoint().lat()+ ", " + headMarker.getPoint().lng()+ " " + "to:" + tailMarker.getPoint().lat() + "," + tailMarker.getPoint().lng(), {getPolyline:true}); } });

    Read the article

  • Problem with mouse event on a user control (wpf).

    - by csciguy
    All, I have a user control, defined as follows. <UserControl x:Class="IDOView.AnimatedCharacter" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:IDOView" mc:Ignorable="d" Background="Transparent" > <Image Name="displayImage" Height="Auto" Width="Auto" Stretch="Fill" IsHitTestVisible="True"/> The control is added to a main page twice, as follows. <local:customControl x:Name="A1" Height="259" Width="197" DisplayImage="circle.png" Canvas.Left="-279" Canvas.Top="-56" MouseLeftButtonUp="DoA1"> <local:customControl x:Name="A1" Height="259" Width="197" DisplayImage="square.png" Canvas.Left="-209" Canvas.Top="-56" MouseLeftButtonUp="DoA2"> Essentially, about half of the circle is behind the square. I need the square image in this case to pass through events to the circle behind it. The square has an element cut out of it (transparent). What is happening now is that the circle event only registers if I click on the region that is not covered by the square. Surely there has to be a way to bubble this event, or click-through?

    Read the article

  • What to call factory-like (java) methods used with immutable objects

    - by StaxMan
    When creating classes for "immutable objects" immutable meaning that state of instances can not be changed; all fields assigned in constructor) in Java (and similar languages), it is sometimes useful to still allow creation of modified instances. That is, using an instance as base, and creating a new instance that differs by just one property value; other values coming from the base instance. To give a simple example, one could have class like: public class Circle { final double x, y; // location final double radius; public Circle(double x, double y, double r) { this.x = x; this.y = y; this.r = r; } // method for creating a new instance, moved in x-axis by specified amount public Circle withOffset(double deltaX) { return new Circle(x+deltaX, y, radius); } } So: what should method "withOffset" be called? (note: NOT what its name ought to be -- but what is this class of methods called). Technically it is kind of a factory method, but somehow that does not seem quite right to me, since often factories are just given basic properties (and are either static methods, or are not members of the result type but factory type). So I am guessing there should be a better term for such methods. Since these methods can be used to implement "fluent interface", maybe they could be "fluent factory methods"? Better suggestions? EDIT: as suggested by one of answers, java.math.BigDecimal is a good example with its 'add', 'subtract' (etc) methods. Also: I noticed that there's this question (by Jon Skeet no less) that is sort of related (although it asks about specific name for method)

    Read the article

  • Why does my program not react to any arguments?

    - by Electric Coffee
    I have a simple test program in C++ that prints out attributes of a circle #include <iostream> #include <stdlib.h> #include "hidden_functions.h" // contains the Circle class using namespace std; void print_circle_attributes(float r) { Circle* c = new Circle(r); cout << "radius: " << c->get_radius() << endl; cout << "diameter: " << c->get_diameter() << endl; cout << "area: " << c->get_area() << endl; cout << "circumference: " << c->get_circumference() << endl; cout << endl; delete c; } int main(int argc, const char* argv[]) { float input = atof(argv[0]); print_circle_attributes(input); return 0; } when I run my program with the parameter 2.4 it outputs: radius: 0.0 diameter: 0.0 area: 0.0 circumference: 0.0 I've previously tested the program without the parameter, but simply using static values, and it ran just fine; so I know there's nothing wrong with the class I made... So what did I do wrong here? Note: the header is called hidden_functions.h because it served to test out how it would work if I had functions not declared in the header

    Read the article

  • php png image transparency

    - by user1334130
    I have been working with some code to draw a circle but I am having problems with removing the black background from the shape. I am using imagecopyresampled for its AA features in order to draw a smooth circle, so I can't use a different drawing function. Thanks. <?php $img_2 = imagecreatetruecolor(200, 200); $red = imagecolorallocate($img_2, 255, 0, 0); imagefill($img_2, 0, 0, $red); //set circle values $xPos = 50; $yPos = 80; $diameter = 40; $img_1 = imagecreatetruecolor(($diameter + 2) * 2, ($diameter + 2) * 2); $green = imagecolorallocate($img_1, 0, 255, 0); //draw the circle imagefilledarc($img_1, $diameter+1, $diameter+1, ($diameter + 2) * 2, ($diameter + 2) * 2, 0, 360, $green, IMG_ARC_PIE); imagecopyresampled($img_2, $img_1, $xPos, $yPos, 0, 0, $diameter+2, $diameter+2, ($diameter + 2) * 2, ($diameter + 2) * 2); header("Content-type: image/png"); imagepng($img_2); imagedestroy($img_1); imagedestroy($img_2); ?>

    Read the article

  • 'area' not declared in this scope

    - by user1641173
    I've just started learning c++ and am trying to write a program for finding the area of a circle. I've written the program and whenever I try to compile it I get 2 error messages. The first is: areaofcircle.cpp:9:14: error: expected unqualified-id before numeric constant and the second is: areaofcircle.cpp:18:5: error: 'area' was not declared in this scope What should I do? I would post a picture, but I'm a new user, so I can't. #include <iostream> using namespace std; #define pi 3.1415926535897932384626433832795 int main() { // Create three float variable values: r, pi, area float r, pi, area; cout << "This program computes the area of a circle." << endl; // Prompt user to enter the radius of the circle, read input value into variable r cout << "Enter the radius of the circle " << endl; cin >> r; // Square r and then multiply by pi area = r * r * pi; cout << "The area is " << area << "." << endl; }

    Read the article

  • Syntax error on token "QUOTE", VariableDeclaratorId expected after this token

    - by user356812
    I've posted a bigger chunk of the code below. You can see that initially QUOTE was procedural- coded in place. I'm trying to learn how to use declarative design so I want to do the same thing but by using resources. It seems like I need to access the string.xml thru the @R.id tag and identify QUOTE with that string value. But I don't know enough to negotiate this. Any tips? Thanks! public class circle extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new GraphicsView(this)); } static public class GraphicsView extends View { //private static final String QUOTE = "Happy Birthday to David."; private final String QUOTE = getString(R.string.quote); ..... @Override protected void onDraw(Canvas canvas) { // Drawing commands go here canvas.drawPath(circle, cPaint); canvas.drawTextOnPath(QUOTE, circle, 0, 20, tPaint);

    Read the article

  • Raphael js library: problems with animateAlong in IE7

    - by Andrei
    Hi there, I'm having trouble making a simple shape move along a path in IE7 (the only version of IE I tried, actually). The following code works fine in chrome and firefox, but not IE. I couldn't find an obvious reason, has anybody seen something similar? canvas.path(rPath.path).attr("stroke", "blue"); var circle = canvas.circle(rPath.startX, rPath.startY, 5); circle.animateAlong(rPath.path, 3000, true); My rPath variable has the path and the starting point coordinates. Microsoft script debugger points to this line as the one where the code breaks: os.left != (t = x - left + "px") && (os.left = t); (line 2131 inside the uncompressed raphael.js script file, inside Element[proto].setBox = function (params, cx, cy) {...}) Any ideas? Any experience (good or bad) with raphael's animateAlong in IE7? TIA, Andrei

    Read the article

  • User input in perl - Issue with running script in KomodoEdit

    - by golwalkar.rohan
    i wrote this tiny code on gedit and ran it :- #/usr/bin/perl print "Enter the radius of circle: \n"; $radius = <>; chomp $radius; print "radius is: $radius\n"; $circumference = (2*3.141592654) * $radius; print "Circumference of circle with radius : $radius = $circumference\n"; Runs fine using command line.Ran the same code on Komodo Edit: facing an issue i expect first line as output as :- Enter the radius of circle: whearas it waits on the screen i.e waiting for an input and after that runs everything in sequence -- can someone tell me why it runs fine with command line but not Komodo?

    Read the article

  • Problems with animateAlong in IE7

    - by Andrei
    Hi there, I'm having trouble making a simple shape move along a path in IE7 (the only version of IE I tried, actually). The following code works fine in chrome and firefox, but not IE. I couldn't find an obvious reason, has anybody seen something similar? canvas.path(rPath.path).attr("stroke", "blue"); var circle = canvas.circle(rPath.startX, rPath.startY, 5); circle.animateAlong(rPath.path, 3000, true); My rPath variable has the path and the starting point coordinates. Microsoft script debugger points to this line as the one where the code breaks: os.left != (t = x - left + "px") && (os.left = t); (line 2131 inside the uncompressed raphael.js script file, inside Element[proto].setBox = function (params, cx, cy) {...}) Any ideas? Any experience (good or bad) with raphael's animateAlong in IE7? TIA, Andrei

    Read the article

  • jqueryui themeroller

    - by cf_PhillipSenn
    I'm learning about the Framework Icons in jQuery UI. <span class="ui-icon ui-icon-circle-minus"></span> produces an icon of a minus sign inside a circle. Using the ThemeRoller Firefox Bookmarklet, I was able to change the color of the icon to red (to make it look like a delete button). Q: How can I make one jQueryUI icon be red and another one another color? <span class="ui-icon ui-icon-circle-plus"></span> I'd like to make this one green.

    Read the article

  • How do I antialias the clip boundary on Android's canvas?

    - by Jesse Wilson
    I'm using Android's android.graphics.Canvas class to draw a ring. My onDraw method clips the canvas to make a hole for the inner circle, and then draws the full outer circle over the hole: clip = new Path(); clip.addRect(outerCircle, Path.Direction.CW); clip.addOval(innerCircle, Path.Direction.CCW); canvas.save(); canvas.clipPath(clip); canvas.drawOval(outerCircle, lightGrey); canvas.restore(); The result is a ring with a pretty, anti-aliased outer edge and a jagged, ugly inner edge: What can I do to antialias the inner edge? I don't want to cheat by drawing a grey circle in the middle because the dialog is slightly transparent. (This transparency isn't as subtle on on other backgrounds.)

    Read the article

  • Raphael - what is the native delay function to draw circles?

    - by 3gwebtrain
    I am using Raphael, to draw 3 circles. how to i make the circles draw each one by one with some time gap? I know there is a option with settimeout, but apart from is there any native function to make delay to draw the circles? my simple code: <div id="paper"></div> var paper = Raphael('paper',500,500); var c1 = paper.circle(50,50,25); var c2 = paper.circle(100,50,25); var c3 = paper.circle(150,50,25); jsfiddle here

    Read the article

  • Questions about my program and Polymorphism

    - by Strobe_
    Ok, so basically I'm creating a program which allows the user to select a shape (triangle, square, circle) and then it takes in a int and calculates the boundary length and area. I have no problem doing this and have a program that's working perfectly. (https://gist.github.com/anonymous/c63a03c129560a7b7434 4 classes) But now I have to implement this with polymorphism concepts and I'm honestly struggling as to how to do it. I have a basic idea of what I want to do when it comes to inheritance Main | Shapes / | \ triangle circle square But I don't understand how I'm supposed to override when all the methods within the triangle/square/circle classes are unique, there are no "abstract" methods as such that I could inherit from the "Shapes" class. If somebody could make look quickly at the code I linked and suggest a way to do this it would be much appreciated. Sorry if I was bad at explaining this. Thanks.

    Read the article

  • Toggle jQuery-UI widgets

    - by cf_PhillipSenn
    I have: <div class="ui-widget"> <div class="ui-widget-header"> <span class="ui-icon ui-icon-circle-triangle-n">My Menu</span> </div> <ul class="ui-widget-content"> <li>Menu Item 1</li> <li>Menu Item 2</li> <li>Menu Item 3</li> </ul> </div> My jQuery is: $('.ui-widget-header').click(function() { $('.ui-widget-header+ul').toggle('slow'); }); Q: How do I toggle classes between ui-icon-circle-triangle-n and ui-icon-circle-triangle-s as the user clicks on .ui-widget-header?

    Read the article

  • Cone-Line Segment Intersection 2D

    - by nophnoph
    Hi everyone, I would like to know is there any way to determine if a cone is intersecting with a (finite)line segment. The cone actually a circle located at P(x,y) with theta degree field of view and radius r. The simple visualization can be found here (sorry i can't post the picture here) I'm trying to do it in C# but I don't have any idea how to that, so for now this is what I'm doing : Check if the line segment is intersecting with the circle If the line segment is intersecting with the circle then I check every single point in the line segment using a function I found here. But I don't think this is the best way to do it. Does anyone have an idea? For additional info, I need this function to make some kind of simple vision simulator. Thanks in advance :)

    Read the article

  • Python: confused with classes, attributes and methods in OOP

    - by user1586038
    A. Am learning Python OOP now and confused with somethings in the code below. Question: 1. def init(self, radius=1): What does the argument/attribute "radius = 1" mean exactly? Why isn't it just called "radius"? The method area() has no argument/attribute "radius". Where does it get its "radius" from in the code? How does it know that the radius is 5? """ class Circle: pi = 3.141592 def __init__(self, radius=1): self.radius = radius def area(self): return self.radius * self.radius * Circle.pi def setRadius(self, radius): self.radius = radius def getRadius(self): return self.radius c = Circle() c.setRadius(5) """ B. Question: In the code below, why is the attribute/argument "name" missing in the brackets? Why was is not written like this: def init(self, name) and def getName(self, name)? """ class Methods: def init(self): self.name = 'Methods' def getName(self): return self.name """

    Read the article

  • Should I be using abstract methods in this Python scenario?

    - by sfjedi
    I'm not sure my approach is good design and I'm hoping I can get a tip. I'm thinking somewhere along the lines of an abstract method, but in this case I want the method to be optional. This is how I'm doing it now... from pymel.core import * class A(object): def __init__(self, *args, **kwargs): if callable(self.createDrivers): self._drivers = self.createDrivers(*args, **kwargs) select(self._drivers) class B(A): def createDrivers(self, *args, **kwargs): c1 = circle(sweep=270)[0] c2 = circle(sweep=180)[0] return c1, c2 b = B() In the above example, I'm just creating 2 circle arcs in PyMEL for Maya, but I fully intend on creating more subclasses that may or may not have a createDrivers method at all! So I want it to be optional and I'm wondering if my approach is—well, if my approach could be improved?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >